Chromium Code Reviews| Index: content/gpu/gpu_child_thread.cc |
| diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc |
| index e40928cd82a696d4dc88f320beac678296625d1a..d59805714b2c7e761451f5175cd5446f9fa9cac4 100644 |
| --- a/content/gpu/gpu_child_thread.cc |
| +++ b/content/gpu/gpu_child_thread.cc |
| @@ -12,6 +12,7 @@ |
| #include "content/child/thread_safe_sender.h" |
| #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| #include "content/common/gpu/gpu_messages.h" |
| +#include "content/gpu/gpu_process_control_impl.h" |
| #include "content/gpu/gpu_watchdog_thread.h" |
| #include "content/public/common/content_client.h" |
| #include "content/public/common/content_switches.h" |
| @@ -182,6 +183,10 @@ void GpuChildThread::Shutdown() { |
| void GpuChildThread::Init(const base::Time& process_start_time) { |
| process_start_time_ = process_start_time; |
| + |
| + process_control_.reset(new GpuProcessControlImpl()); |
| + service_registry()->AddService(base::Bind( |
| + &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); |
|
piman
2015/10/06 19:59:36
What makes Unretained safe?
xhwang
2015/10/07 19:07:58
Added comment.
|
| } |
| bool GpuChildThread::Send(IPC::Message* msg) { |
| @@ -374,4 +379,10 @@ void GpuChildThread::OnGpuSwitched() { |
| ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
| } |
| +void GpuChildThread::BindProcessControlRequest( |
| + mojo::InterfaceRequest<ProcessControl> request) { |
| + DCHECK(process_control_); |
| + process_control_bindings_.AddBinding(process_control_.get(), request.Pass()); |
| +} |
| + |
| } // namespace content |