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

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

Issue 2498203004: Move media::mojom::RemoterFactory to content, add ContentBrowserClient API. (Closed)
Patch Set: The fix: Add/register a default RemoterFactory in RenderFrameHostImpl. Created 4 years, 1 month 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 524168e7fd86d30d90b82f00d8608e04decf3b12..857cd1ef343c66ce041788a68a1b9db8a82777ec 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -96,7 +96,9 @@
#include "device/vibration/vibration_manager_impl.h"
#include "device/wake_lock/wake_lock_service_context.h"
#include "media/base/media_switches.h"
+#include "media/media_features.h"
#include "media/mojo/interfaces/media_service.mojom.h"
+#include "media/mojo/interfaces/remoting.mojom.h"
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/connector.h"
@@ -2249,6 +2251,23 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
}
#endif
+#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
+ // Add a no-op RemoterFactory binder. Embedders that support media remoting
+ // will override this via their ContentBrowserClient.
+ class NullRemoterFactory final : public media::mojom::RemoterFactory {
Ben Goodger (Google) 2016/11/16 18:56:13 Since the renderer requires this always, rather th
miu 2016/11/16 22:30:06 Done. Prior to this, I had assumed it was normal/S
+ public:
+ void Create(media::mojom::RemotingSourcePtr source,
+ media::mojom::RemoterRequest remoter) final {}
+ static void CreateRemoterFactory(
+ media::mojom::RemoterFactoryRequest request) {
+ mojo::MakeStrongBinding(base::MakeUnique<NullRemoterFactory>(),
+ std::move(request));
+ }
+ };
+ GetInterfaceRegistry()->AddInterface(
+ base::Bind(&NullRemoterFactory::CreateRemoterFactory));
+#endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
+
GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces(
GetInterfaceRegistry(), this);
}

Powered by Google App Engine
This is Rietveld 408576698