diff options
5 files changed, 3 insertions, 33 deletions
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 8c06e81..bf8ce2b 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -309,7 +309,6 @@ RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() { } ServiceRegistry* RenderFrameHostImpl::GetServiceRegistry() { - static_cast<RenderProcessHostImpl*>(GetProcess())->EnsureMojoActivated(); return &service_registry_; } diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc index 3af7974..b752973 100644 --- a/content/browser/mojo/mojo_application_host.cc +++ b/content/browser/mojo/mojo_application_host.cc @@ -47,7 +47,7 @@ bool MojoApplicationHost::Init() { return true; } -bool MojoApplicationHost::Activate(IPC::Sender* sender, +void MojoApplicationHost::Activate(IPC::Sender* sender, base::ProcessHandle process_handle) { DCHECK(!did_activate_); DCHECK(client_handle_.is_valid()); @@ -56,7 +56,6 @@ bool MojoApplicationHost::Activate(IPC::Sender* sender, PlatformFileFromScopedPlatformHandle(client_handle_.Pass()); did_activate_ = sender->Send(new MojoMsg_Activate( IPC::GetFileHandleForProcess(client_file, process_handle, true))); - return did_activate_; } void MojoApplicationHost::WillDestroySoon() { diff --git a/content/browser/mojo/mojo_application_host.h b/content/browser/mojo/mojo_application_host.h index 27a43f8..238525d 100644 --- a/content/browser/mojo/mojo_application_host.h +++ b/content/browser/mojo/mojo_application_host.h @@ -30,12 +30,10 @@ class MojoApplicationHost { // 1- Init makes service_registry() available synchronously. // 2- Activate establishes the actual connection to the peer process. bool Init(); - bool Activate(IPC::Sender* sender, base::ProcessHandle process_handle); + void Activate(IPC::Sender* sender, base::ProcessHandle process_handle); void WillDestroySoon(); - bool did_activate() const { return did_activate_; } - ServiceRegistry* service_registry() { return &service_registry_; } private: diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index a95102f..7b58cc9 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -440,7 +440,6 @@ RenderProcessHostImpl::RenderProcessHostImpl( #endif pending_views_(0), mojo_application_host_(new MojoApplicationHost), - mojo_activation_required_(false), visible_widgets_(0), backgrounded_(true), is_initialized_(false), @@ -645,20 +644,6 @@ bool RenderProcessHostImpl::Init() { return true; } -void RenderProcessHostImpl::MaybeActivateMojo() { - // TODO(darin): Following security review, we can unconditionally initialize - // Mojo in all renderers. We will then be able to directly call Activate() - // from OnProcessLaunched. - if (!mojo_activation_required_) - return; // Waiting on someone to require Mojo. - - if (!GetHandle()) - return; // Waiting on renderer startup. - - if (!mojo_application_host_->did_activate()) - mojo_application_host_->Activate(this, GetHandle()); -} - bool RenderProcessHostImpl::ShouldUseMojoChannel() const { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); @@ -1936,7 +1921,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) { } mojo_application_host_.reset(new MojoApplicationHost); - mojo_activation_required_ = false; // It's possible that one of the calls out to the observers might have caused // this object to be no longer needed. @@ -2103,7 +2087,7 @@ void RenderProcessHostImpl::OnProcessLaunched() { // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. // This way, Mojo can be safely used from the renderer in response to any // Chrome IPC message. - MaybeActivateMojo(); + mojo_application_host_->Activate(this, GetHandle()); if (channel_mojo_host_) channel_mojo_host_->OnClientLaunched(GetHandle()); @@ -2247,9 +2231,4 @@ void RenderProcessHostImpl::DecrementWorkerRefCount() { Cleanup(); } -void RenderProcessHostImpl::EnsureMojoActivated() { - mojo_activation_required_ = true; - MaybeActivateMojo(); -} - } // namespace content diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 92d1e4d..bdc11f2 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h @@ -256,9 +256,6 @@ class CONTENT_EXPORT RenderProcessHostImpl // immediately after receiving response headers. void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); - // Activates Mojo for this process. Does nothing if Mojo is already activated. - void EnsureMojoActivated(); - protected: // A proxy for our IPC::Channel that lives on the IO thread (see // browser_process.h) @@ -287,7 +284,6 @@ class CONTENT_EXPORT RenderProcessHostImpl private: friend class VisitRelayingRenderProcessHost; - void MaybeActivateMojo(); bool ShouldUseMojoChannel() const; scoped_ptr<IPC::ChannelProxy> CreateChannelProxy( const std::string& channel_id); @@ -335,7 +331,6 @@ class CONTENT_EXPORT RenderProcessHostImpl #endif scoped_ptr<MojoApplicationHost> mojo_application_host_; - bool mojo_activation_required_; // The registered IPC listener objects. When this list is empty, we should // delete ourselves. |