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

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

Issue 2498203004: Move media::mojom::RemoterFactory to content, add ContentBrowserClient API. (Closed)
Patch Set: REBASE 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
« no previous file with comments | « chrome/browser/media/cast_remoting_connector.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0a0ecfc7d4c67e6769620c8bd7bbd9e106b951d0..0ac8ad5a809b3fd2830d487ed573261dfa1875a8 100644
--- a/chrome/browser/media/cast_remoting_connector.cc
+++ b/chrome/browser/media/cast_remoting_connector.cc
@@ -29,37 +29,6 @@ using media::mojom::RemotingStopReason;
using Messaging = CastRemotingConnectorMessaging;
-class CastRemotingConnector::FrameRemoterFactory
- : public media::mojom::RemoterFactory {
- public:
- // |render_frame_host| represents the source render frame. It could be
- // destroyed at any time and so the process/routing IDs are used as a weak
- // reference.
- explicit FrameRemoterFactory(content::RenderFrameHost* render_frame_host)
- : render_frame_process_id_(render_frame_host->GetProcess()->GetID()),
- render_frame_routing_id_(render_frame_host->GetRoutingID()) {}
- ~FrameRemoterFactory() final {}
-
- void Create(media::mojom::RemotingSourcePtr source,
- media::mojom::RemoterRequest request) final {
- auto* const host = content::RenderFrameHost::FromID(
- render_frame_process_id_, render_frame_routing_id_);
- if (!host)
- return;
- auto* const contents = content::WebContents::FromRenderFrameHost(host);
- if (!contents)
- return;
- CastRemotingConnector::Get(contents)->CreateBridge(std::move(source),
- std::move(request));
- }
-
- private:
- const int render_frame_process_id_;
- const int render_frame_routing_id_;
-
- DISALLOW_COPY_AND_ASSIGN(FrameRemoterFactory);
-};
-
class CastRemotingConnector::RemotingBridge : public media::mojom::Remoter {
public:
// Constructs a "bridge" to delegate calls between the given |source| and
@@ -176,13 +145,16 @@ CastRemotingConnector* CastRemotingConnector::Get(
}
// static
-void CastRemotingConnector::CreateRemoterFactory(
- content::RenderFrameHost* render_frame_host,
- media::mojom::RemoterFactoryRequest request) {
- DCHECK(render_frame_host);
- mojo::MakeStrongBinding(
- base::MakeUnique<FrameRemoterFactory>(render_frame_host),
- std::move(request));
+void CastRemotingConnector::CreateMediaRemoter(
+ content::RenderFrameHost* host,
+ media::mojom::RemotingSourcePtr source,
+ media::mojom::RemoterRequest request) {
+ DCHECK(host);
+ auto* const contents = content::WebContents::FromRenderFrameHost(host);
+ if (!contents)
+ return;
+ CastRemotingConnector::Get(contents)->CreateBridge(std::move(source),
+ std::move(request));
}
CastRemotingConnector::CastRemotingConnector(
« no previous file with comments | « chrome/browser/media/cast_remoting_connector.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698