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

Unified Diff: trunk/src/content/browser/renderer_host/render_view_host_impl.cc

Issue 352013002: Revert 279557 "Support exposing Mojo services between render fra..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/content/browser/renderer_host/render_view_host_impl.cc
===================================================================
--- trunk/src/content/browser/renderer_host/render_view_host_impl.cc (revision 279559)
+++ trunk/src/content/browser/renderer_host/render_view_host_impl.cc (working copy)
@@ -48,9 +48,11 @@
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
#include "content/common/inter_process_time_ticks_converter.h"
+#include "content/common/mojo/mojo_service_names.h"
#include "content/common/speech_recognition_messages.h"
#include "content/common/swapped_out_messages.h"
#include "content/common/view_messages.h"
+#include "content/common/web_ui_setup.mojom.h"
#include "content/public/browser/ax_event_notification_details.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_context.h"
@@ -654,6 +656,27 @@
GetProcess()->GetID(), GetRoutingID(), has_pending_request);
}
+void RenderViewHostImpl::SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) {
+ // Never grant any bindings to browser plugin guests.
+ if (GetProcess()->IsIsolatedGuest()) {
+ NOTREACHED() << "Never grant bindings to a guest process.";
+ return;
+ }
+
+ if ((enabled_bindings_ & BINDINGS_POLICY_WEB_UI) == 0) {
+ NOTREACHED() << "You must grant bindings before setting the handle";
+ return;
+ }
+
+ DCHECK(renderer_initialized_);
+
+ WebUISetupPtr web_ui_setup;
+ static_cast<RenderProcessHostImpl*>(GetProcess())->ConnectTo(
+ kRendererService_WebUISetup, &web_ui_setup);
+
+ web_ui_setup->SetWebUIHandle(GetRoutingID(), handle.Pass());
+}
+
#if defined(OS_ANDROID)
void RenderViewHostImpl::ActivateNearestFindResult(int request_id,
float x,

Powered by Google App Engine
This is Rietveld 408576698