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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2380793002: Migrate MediaDevices.enumerateDevices to Mojo (Closed)
Patch Set: add missing file 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 1cf8c1fed9f951f3f47395f3c9a9b8e1acf22941..39dca0007b2edaa43ac42bffba5d2a33e31b826e 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -20,6 +20,7 @@
#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "content/browser/bluetooth/web_bluetooth_service_impl.h"
+#include "content/browser/browser_main_loop.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/devtools/render_frame_devtools_agent_host.h"
#include "content/browser/download/mhtml_generation_manager.h"
@@ -40,6 +41,7 @@
#include "content/browser/presentation/presentation_service_impl.h"
#include "content/browser/renderer_host/input/input_router_impl.h"
#include "content/browser/renderer_host/input/timeout_monitor.h"
+#include "content/browser/renderer_host/media/media_devices_dispatcher_host.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_delegate_view.h"
@@ -71,6 +73,7 @@
#include "content/public/browser/permission_type.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/stream_handle.h"
#include "content/public/browser/user_metrics.h"
@@ -2192,6 +2195,21 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
}
+#if defined(ENABLE_WEBRTC)
+ MediaStreamManager* media_stream_manager =
+ BrowserMainLoop::GetInstance()->media_stream_manager();
+ GetInterfaceRegistry()->AddInterface(
+ base::Bind(&MediaDevicesDispatcherHost::Create, GetProcess()->GetID(),
+ GetRoutingID(), GetProcess()
+ ->GetBrowserContext()
+ ->GetResourceContext()
+ ->GetMediaDeviceIDSalt(),
+ base::Unretained(media_stream_manager),
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeUIForMediaStream)),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
+#endif
+
GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces(
GetInterfaceRegistry(), this);
}

Powered by Google App Engine
This is Rietveld 408576698