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

Unified Diff: chrome/browser/media/router/mojo/media_router_mojo_impl.cc

Issue 1862913004: [Media Router] Wire through a new MRPM call to update media sinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing run loops Created 4 years, 8 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/router/mojo/media_router_mojo_impl.cc
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc
index d9c822cc294ccf15129f028caa447a5b06183d12..c2cacffcb0a6770c44880eb884c1b745bc236453 100644
--- a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc
+++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/media/router/media_router_factory.h"
#include "chrome/browser/media/router/media_routes_observer.h"
#include "chrome/browser/media/router/media_sinks_observer.h"
+#include "chrome/browser/media/router/media_source_helper.h"
#include "chrome/browser/media/router/mojo/media_route_provider_util_win.h"
#include "chrome/browser/media/router/mojo/media_router_mojo_metrics.h"
#include "chrome/browser/media/router/mojo/media_router_type_converters.h"
@@ -429,6 +430,10 @@ void MediaRouterMojoImpl::ClearIssue(const Issue::Id& issue_id) {
}
void MediaRouterMojoImpl::OnUserGesture() {
+ // Allow MRPM to intelligently update sinks and observers by passing in a
+ // media source.
mark a. foltz 2016/04/22 22:20:38 I think some comment here about why we're discover
+ UpdateMediaSinks(MediaSourceForDesktop().id());
+
#if defined(OS_WIN)
EnsureMdnsDiscoveryEnabled();
#endif
@@ -988,4 +993,17 @@ void MediaRouterMojoImpl::OnFirewallCheckComplete(
}
#endif
+void MediaRouterMojoImpl::UpdateMediaSinks(
+ const MediaSource::Id& source_id) {
+ SetWakeReason(MediaRouteProviderWakeReason::UPDATE_MEDIA_SINKS);
mark a. foltz 2016/04/22 22:20:38 We should see wakeups < the number of times the di
+ RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoUpdateMediaSinks,
+ base::Unretained(this), source_id));
+}
+
+void MediaRouterMojoImpl::DoUpdateMediaSinks(
+ const MediaSource::Id& source_id) {
+ DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id;
+ media_route_provider_->UpdateMediaSinks(source_id);
+}
+
} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698