Index: content/browser/gpu/gpu_process_host.cc |
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc |
index 67113b67bf76e8cf2a2ead2a447efdcd1485dad8..4391509f70b24c5a030d74d1fb35fd30aff51e7a 100644 |
--- a/content/browser/gpu/gpu_process_host.cc |
+++ b/content/browser/gpu/gpu_process_host.cc |
@@ -31,7 +31,9 @@ |
#include "content/browser/gpu/gpu_data_manager_impl.h" |
#include "content/browser/gpu/gpu_process_host_ui_shim.h" |
#include "content/browser/gpu/shader_disk_cache.h" |
-#include "content/browser/mojo/mojo_application_host.h" |
+#include "content/browser/mojo/constants.h" |
+#include "content/browser/mojo/mojo_child_connection.h" |
+#include "content/browser/mojo/mojo_shell_context.h" |
#include "content/browser/renderer_host/render_widget_host_impl.h" |
#include "content/common/child_process_host_impl.h" |
#include "content/common/establish_channel_params.h" |
@@ -47,6 +49,7 @@ |
#include "content/public/common/content_client.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/common/mojo_channel_switches.h" |
+#include "content/public/common/mojo_shell_connection.h" |
#include "content/public/common/result_codes.h" |
#include "content/public/common/sandbox_type.h" |
#include "content/public/common/sandboxed_process_launcher_delegate.h" |
@@ -57,6 +60,9 @@ |
#include "ipc/message_filter.h" |
#include "media/base/media_switches.h" |
#include "mojo/edk/embedder/embedder.h" |
+#include "services/shell/public/cpp/connection.h" |
+#include "services/shell/public/cpp/interface_provider.h" |
+#include "services/shell/public/cpp/interface_registry.h" |
#include "ui/base/ui_base_switches.h" |
#include "ui/events/latency_info.h" |
#include "ui/gl/gl_switches.h" |
@@ -550,8 +556,12 @@ bool GpuProcessHost::Init() { |
if (channel_id.empty()) |
return false; |
- DCHECK(!mojo_application_host_); |
- mojo_application_host_.reset(new MojoApplicationHost(child_token_)); |
+ DCHECK(!mojo_child_connection_); |
+ mojo_child_connection_.reset(new MojoChildConnection( |
+ kGpuMojoApplicationName, |
+ "", |
+ child_token_, |
+ MojoShellContext::GetConnectorForIOThread())); |
gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); |
if (in_process_) { |
@@ -560,7 +570,7 @@ bool GpuProcessHost::Init() { |
in_process_gpu_thread_.reset(g_gpu_main_thread_factory( |
InProcessChildThreadParams( |
channel_id, base::ThreadTaskRunnerHandle::Get(), std::string(), |
- mojo_application_host_->GetToken()), |
+ mojo_child_connection_->shell_client_token()), |
gpu_preferences)); |
base::Thread::Options options; |
#if defined(OS_WIN) |
@@ -945,8 +955,12 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) { |
process_->GetTerminationStatus(true /* known_dead */, NULL)); |
} |
-ServiceRegistry* GpuProcessHost::GetServiceRegistry() { |
- return mojo_application_host_->service_registry(); |
+shell::InterfaceRegistry* GpuProcessHost::GetInterfaceRegistry() { |
+ return mojo_child_connection_->connection()->GetInterfaceRegistry(); |
+} |
+ |
+shell::InterfaceProvider* GpuProcessHost::GetRemoteInterfaces() { |
+ return mojo_child_connection_->connection()->GetRemoteInterfaces(); |
} |
GpuProcessHost::GpuProcessKind GpuProcessHost::kind() { |
@@ -1004,7 +1018,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id, |
cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); |
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
cmd_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken, |
- mojo_application_host_->GetToken()); |
+ mojo_child_connection_->shell_client_token()); |
BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line); |
#if defined(OS_WIN) |