Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2032)

Unified Diff: chrome/browser/media/router/media_route.cc

Issue 1259073004: [Presentation API] Change ListenForSessionMessages API to client-style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/router/media_route.h ('k') | chrome/browser/media/router/media_route_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/router/media_route.cc
diff --git a/chrome/browser/media/router/media_route.cc b/chrome/browser/media/router/media_route.cc
index 8fab82731670a6029c06fa7aa3eac4cc5a40f04b..b5838d37aeeabe69614dacfe4d453825621d84ed 100644
--- a/chrome/browser/media/router/media_route.cc
+++ b/chrome/browser/media/router/media_route.cc
@@ -7,10 +7,6 @@
#include "base/logging.h"
#include "chrome/browser/media/router/media_source.h"
-namespace {
-const char kRouteUrnPrefix[] = "urn:x-org.chromium:media:route:";
-}
-
namespace media_router {
MediaRoute::MediaRoute(const MediaRoute::Id& media_route_id,
@@ -33,39 +29,6 @@ bool MediaRoute::Equals(const MediaRoute& other) const {
return media_route_id_ == other.media_route_id_;
}
-// <route-id> =
-// urn:x-org.chromium:media:route:<presentation-id>/<sink>/<source>
-// <source> = <url>|<capture-source>
-// <sink> = <provider-name>-<sink-id>
-std::pair<std::string, std::string> GetPresentationIdAndUrl(
- const MediaRoute::Id& id) {
- if (id.find(kRouteUrnPrefix) != 0) {
- LOG(ERROR) << "Invalid media route ID. Expecting prefix "
- << kRouteUrnPrefix;
- return std::make_pair(std::string(), std::string());
- }
- size_t prefix_len = arraysize(kRouteUrnPrefix) - 1;
- size_t first_delim = id.find("/");
- if (first_delim == std::string::npos || first_delim == prefix_len) {
- LOG(ERROR) << "Invalid media route ID. Expecting presentation ID.";
- return std::make_pair(std::string(), std::string());
- }
-
- std::string presentation_id = id.substr(prefix_len, first_delim - prefix_len);
- size_t second_delim = id.find("/", first_delim + 1);
- if (second_delim == std::string::npos || second_delim == first_delim + 1) {
- LOG(ERROR) << "Invalid media route ID. Expecting sink.";
- return std::make_pair(std::string(), std::string());
- }
-
- if (second_delim == id.size() - 1) {
- LOG(ERROR) << "Invalid media route ID. Expecting source.";
- return std::make_pair(std::string(), std::string());
- }
- std::string source = id.substr(second_delim + 1);
- return std::make_pair(presentation_id, source);
-}
-
MediaRouteIdToPresentationSessionMapping::
MediaRouteIdToPresentationSessionMapping() {
}
« no previous file with comments | « chrome/browser/media/router/media_route.h ('k') | chrome/browser/media/router/media_route_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698