Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index febc934e3db00bb6f2e11167b69972fc3a3e22bb..38db2bb8a2e7e1f1dd2a304dc8a5e21eda590cff 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -172,6 +172,8 @@ |
#include "mojo/edk/embedder/embedder.h" |
#include "net/url_request/url_request_context_getter.h" |
#include "ppapi/shared_impl/ppapi_switches.h" |
+#include "services/shell/public/cpp/interface_provider.h" |
+#include "services/shell/public/cpp/interface_registry.h" |
#include "services/shell/runner/common/switches.h" |
#include "storage/browser/fileapi/sandbox_file_system_backend.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -602,6 +604,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( |
#endif // defined(OS_MACOSX) |
#endif // USE_ATTACHMENT_BROKER |
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner = |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
shell::Connector* connector = |
BrowserContext::GetShellConnectorFor(browser_context_); |
// Some embedders may not initialize Mojo or the shell connector for a browser |
@@ -615,15 +619,14 @@ RenderProcessHostImpl::RenderProcessHostImpl( |
shell::mojom::ShellClientRequest request = |
mojo::GetProxy(&test_shell_client_); |
MojoShellConnection::SetForProcess(MojoShellConnection::Create( |
- std::move(request))); |
+ std::move(request), io_task_runner)); |
} |
connector = MojoShellConnection::GetForProcess()->GetConnector(); |
} |
mojo_child_connection_.reset(new MojoChildConnection( |
kRendererMojoApplicationName, |
- base::StringPrintf("%d_%d", id_, instance_id_++), |
- child_token_, |
- connector)); |
+ base::StringPrintf("%d_%d", id_, instance_id_++), child_token_, connector, |
+ io_task_runner)); |
} |
// static |
@@ -748,8 +751,7 @@ bool RenderProcessHostImpl::Init() { |
in_process_renderer_.reset( |
g_renderer_main_thread_factory(InProcessChildThreadParams( |
channel_id, |
- BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
- ->task_runner(), |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
mojo_channel_token_, |
mojo_child_connection_->shell_client_token()))); |
@@ -1104,16 +1106,11 @@ void RenderProcessHostImpl::NotifyTimezoneChange(const std::string& zone_id) { |
} |
shell::InterfaceRegistry* RenderProcessHostImpl::GetInterfaceRegistry() { |
- return GetChildConnection()->GetInterfaceRegistry(); |
+ return mojo_child_connection_->GetInterfaceRegistry(); |
} |
shell::InterfaceProvider* RenderProcessHostImpl::GetRemoteInterfaces() { |
- return GetChildConnection()->GetRemoteInterfaces(); |
-} |
- |
-shell::Connection* RenderProcessHostImpl::GetChildConnection() { |
- DCHECK(mojo_child_connection_); |
- return mojo_child_connection_->connection(); |
+ return mojo_child_connection_->GetRemoteInterfaces(); |
} |
std::unique_ptr<base::SharedPersistentMemoryAllocator> |
@@ -2432,9 +2429,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead, |
connector = MojoShellConnection::GetForProcess()->GetConnector(); |
mojo_child_connection_.reset(new MojoChildConnection( |
kRendererMojoApplicationName, |
- base::StringPrintf("%d_%d", id_, instance_id_++), |
- child_token_, |
- connector)); |
+ base::StringPrintf("%d_%d", id_, instance_id_++), child_token_, connector, |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
within_process_died_observer_ = true; |
NotificationService::current()->Notify( |