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

Unified Diff: chrome/browser/media/cast_remoting_connector.cc

Issue 2382623003: CastRemotingConnector: Fix wrong assumption about MR route filtering. (Closed)
Patch Set: Tweak variable name. Created 4 years, 3 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
Index: chrome/browser/media/cast_remoting_connector.cc
diff --git a/chrome/browser/media/cast_remoting_connector.cc b/chrome/browser/media/cast_remoting_connector.cc
index 02e22559e007210609aafa537d5e009ad985c6d7..da23cd399dc2e9a8cdcc4a1d0fe3699fbdff5edc 100644
--- a/chrome/browser/media/cast_remoting_connector.cc
+++ b/chrome/browser/media/cast_remoting_connector.cc
@@ -234,8 +234,9 @@ void CastRemotingConnector::CreateRemoterFactory(
CastRemotingConnector::CastRemotingConnector(
media_router::MediaRouter* router,
- const media_router::MediaSource::Id& route_source_id)
- : media_router::MediaRoutesObserver(router, route_source_id),
+ const media_router::MediaSource::Id& media_source_id)
+ : media_router::MediaRoutesObserver(router),
+ media_source_id_(media_source_id),
session_counter_(0),
active_bridge_(nullptr),
weak_factory_(this) {}
@@ -548,8 +549,9 @@ void CastRemotingConnector::OnRoutesUpdated(
// Scan |routes| for a new remoting route. If one is found, begin processing
// messages on the route, and notify the sources that remoting is now
// available.
- if (!routes.empty()) {
- const media_router::MediaRoute& route = routes.front();
+ for (const media_router::MediaRoute& route : routes) {
+ if (route.media_source().id() != media_source_id_)
+ continue;
message_observer_.reset(new MessageObserver(
media_router::MediaRoutesObserver::router(), route.media_route_id(),
this));
@@ -558,5 +560,6 @@ void CastRemotingConnector::OnRoutesUpdated(
// notification.
for (RemotingBridge* notifyee : bridges_)
notifyee->OnSinkAvailable();
+ break;
}
}
« no previous file with comments | « chrome/browser/media/cast_remoting_connector.h ('k') | chrome/browser/media/cast_remoting_connector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698