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

Unified Diff: trunk/src/content/browser/renderer_host/render_process_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_process_host_impl.cc
===================================================================
--- trunk/src/content/browser/renderer_host/render_process_host_impl.cc (revision 279559)
+++ trunk/src/content/browser/renderer_host/render_process_host_impl.cc (working copy)
@@ -69,6 +69,7 @@
#include "content/browser/media/midi_host.h"
#include "content/browser/message_port_message_filter.h"
#include "content/browser/mime_registry_message_filter.h"
+#include "content/browser/mojo/mojo_application_host.h"
#include "content/browser/plugin_service_impl.h"
#include "content/browser/profiler_message_filter.h"
#include "content/browser/push_messaging_message_filter.h"
@@ -140,6 +141,7 @@
#include "ipc/ipc_logging.h"
#include "ipc/ipc_switches.h"
#include "media/base/media_switches.h"
+#include "mojo/common/common_type_converters.h"
#include "net/url_request/url_request_context_getter.h"
#include "ppapi/shared_impl/ppapi_switches.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -446,7 +448,6 @@
is_self_deleted_(false),
#endif
pending_views_(0),
- mojo_application_host_(new MojoApplicationHost),
mojo_activation_required_(false),
visible_widgets_(0),
backgrounded_(true),
@@ -596,6 +597,7 @@
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get());
// Setup the Mojo channel.
+ mojo_application_host_.reset(new MojoApplicationHost());
mojo_application_host_->Init();
// Call the embedder first so that their IPC filters have priority.
@@ -906,12 +908,6 @@
Send(new ViewMsg_TimezoneChange());
}
-ServiceRegistry* RenderProcessHostImpl::GetServiceRegistry() {
- if (!mojo_application_host_)
- return NULL;
- return mojo_application_host_->service_registry();
-}
-
void RenderProcessHostImpl::AddRoute(
int32 routing_id,
IPC::Listener* listener) {
@@ -1938,8 +1934,7 @@
iter.Advance();
}
- mojo_application_host_.reset(new MojoApplicationHost);
- mojo_activation_required_ = false;
+ mojo_application_host_.reset();
// It's possible that one of the calls out to the observers might have caused
// this object to be no longer needed.
@@ -2259,9 +2254,17 @@
Cleanup();
}
-void RenderProcessHostImpl::EnsureMojoActivated() {
+void RenderProcessHostImpl::ConnectTo(
+ const base::StringPiece& service_name,
+ mojo::ScopedMessagePipeHandle handle) {
mojo_activation_required_ = true;
MaybeActivateMojo();
+
+ mojo_application_host_->service_provider()->ConnectToService(
+ mojo::String::From(service_name),
+ std::string(),
+ handle.Pass(),
+ mojo::String());
}
void RenderProcessHostImpl::OnAllocateGpuMemoryBuffer(uint32 width,

Powered by Google App Engine
This is Rietveld 408576698