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

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

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 6 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bfeee98bd53588b5fd912e02fbeef89ebd1dda74..9ffcbefc924cc08ab0dd7b2bf85c8c55cf0d0f16 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -18,6 +18,7 @@
#include "content/browser/frame_host/render_frame_proxy_host.h"
#include "content/browser/renderer_host/input/input_router.h"
#include "content/browser/renderer_host/input/timeout_monitor.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/transition_request_manager.h"
@@ -25,6 +26,7 @@
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
#include "content/common/inter_process_time_ticks_converter.h"
+#include "content/common/render_frame_setup.mojom.h"
#include "content/common/swapped_out_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -162,6 +164,16 @@ RenderFrameHostImpl::RenderFrameHostImpl(
g_routing_id_frame_map.Get().insert(std::make_pair(
RenderFrameHostID(GetProcess()->GetID(), routing_id_),
this));
+
+ if (GetProcess()->GetServiceRegistry()) {
+ RenderFrameSetupPtr setup;
+ GetProcess()->GetServiceRegistry()->GetRemoteInterface(&setup);
+ mojo::IInterfaceProviderPtr service_provider;
+ setup->GetServiceProviderForFrame(routing_id_,
+ mojo::Get(&service_provider));
+ service_registry_.BindRemoteServiceProvider(
+ service_provider.PassMessagePipe());
+ }
}
RenderFrameHostImpl::~RenderFrameHostImpl() {
@@ -242,6 +254,11 @@ RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() {
return render_view_host_;
}
+ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() {
+ static_cast<RenderProcessHostImpl*>(GetProcess())->EnsureMojoActivated();
+ return &service_registry_;
+}
+
bool RenderFrameHostImpl::Send(IPC::Message* message) {
if (IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart) {
return render_view_host_->input_router()->SendInput(
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698