| Index: content/gpu/gpu_child_thread.cc
|
| diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
|
| index 2f05bb5f907bf75231814ff39e672059ecfef92f..c79f49bccef75fcf605fe73b0f1b1061054a3514 100644
|
| --- a/content/gpu/gpu_child_thread.cc
|
| +++ b/content/gpu/gpu_child_thread.cc
|
| @@ -135,6 +135,7 @@ ChildThreadImpl::Options GetOptions(
|
| if (message_filter)
|
| builder.AddStartupFilter(message_filter);
|
| #endif
|
| + builder.UseMojoShellConnection(true);
|
|
|
| return builder.Build();
|
| }
|
| @@ -174,6 +175,7 @@ GpuChildThread::GpuChildThread(
|
| .InBrowserProcess(params)
|
| .AddStartupFilter(new GpuMemoryBufferMessageFilter(
|
| gpu_memory_buffer_factory))
|
| + .UseMojoShellConnection(true)
|
| .Build()),
|
| gpu_preferences_(gpu_preferences),
|
| dead_on_arrival_(false),
|
| @@ -220,16 +222,8 @@ void GpuChildThread::Init(const base::Time& process_start_time) {
|
| // Only set once per process instance.
|
| process_control_.reset(new GpuProcessControlImpl());
|
|
|
| - // Use of base::Unretained(this) is safe here because |service_registry()|
|
| - // will be destroyed before GpuChildThread is destructed.
|
| - GetInterfaceRegistry()->AddInterface(base::Bind(
|
| - &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
|
| -
|
| - if (GetContentClient()->gpu()) { // NULL in tests.
|
| + if (GetContentClient()->gpu()) // NULL in tests.
|
| GetContentClient()->gpu()->Initialize(this);
|
| - GetContentClient()->gpu()->ExposeInterfacesToBrowser(
|
| - GetInterfaceRegistry());
|
| - }
|
| }
|
|
|
| void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name,
|
| @@ -297,6 +291,27 @@ bool GpuChildThread::OnMessageReceived(const IPC::Message& msg) {
|
| return false;
|
| }
|
|
|
| +bool GpuChildThread::AcceptConnection(shell::Connection* connection) {
|
| + // Use of base::Unretained(this) is safe here because |service_registry()|
|
| + // will be destroyed before GpuChildThread is destructed.
|
| + connection->GetInterfaceRegistry()->AddInterface(base::Bind(
|
| + &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
|
| +
|
| + if (GetContentClient()->gpu()) { // NULL in tests.
|
| + GetContentClient()->gpu()->ExposeInterfacesToBrowser(
|
| + connection->GetInterfaceRegistry());
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +shell::InterfaceRegistry* GpuChildThread::GetInterfaceRegistryForConnection() {
|
| + return nullptr;
|
| +}
|
| +
|
| +shell::InterfaceProvider* GpuChildThread::GetInterfaceProviderForConnection() {
|
| + return nullptr;
|
| +}
|
| +
|
| void GpuChildThread::SetActiveURL(const GURL& url) {
|
| GetContentClient()->SetActiveURL(url);
|
| }
|
|
|