| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 | 224 |
| 225 void GpuChildThread::Shutdown() { | 225 void GpuChildThread::Shutdown() { |
| 226 ChildThreadImpl::Shutdown(); | 226 ChildThreadImpl::Shutdown(); |
| 227 logging::SetLogMessageHandler(NULL); | 227 logging::SetLogMessageHandler(NULL); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void GpuChildThread::Init(const base::Time& process_start_time) { | 230 void GpuChildThread::Init(const base::Time& process_start_time) { |
| 231 process_start_time_ = process_start_time; | 231 process_start_time_ = process_start_time; |
| 232 | 232 |
| 233 process_control_.reset(new GpuProcessControlImpl()); | 233 process_control_.reset( |
| 234 new GpuProcessControlImpl(message_loop()->task_runner())); |
| 235 |
| 234 // Use of base::Unretained(this) is safe here because |service_registry()| | 236 // Use of base::Unretained(this) is safe here because |service_registry()| |
| 235 // will be destroyed before GpuChildThread is destructed. | 237 // will be destroyed before GpuChildThread is destructed. |
| 236 service_registry()->AddService(base::Bind( | 238 service_registry()->AddService(base::Bind( |
| 237 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); | 239 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); |
| 238 | 240 |
| 239 if (GetContentClient()->gpu()) // NULL in tests. | 241 if (GetContentClient()->gpu()) // NULL in tests. |
| 240 GetContentClient()->gpu()->RegisterMojoServices(service_registry()); | 242 GetContentClient()->gpu()->RegisterMojoServices(service_registry()); |
| 241 } | 243 } |
| 242 | 244 |
| 243 bool GpuChildThread::Send(IPC::Message* msg) { | 245 bool GpuChildThread::Send(IPC::Message* msg) { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 590 |
| 589 void GpuChildThread::BindProcessControlRequest( | 591 void GpuChildThread::BindProcessControlRequest( |
| 590 mojo::InterfaceRequest<mojom::ProcessControl> request) { | 592 mojo::InterfaceRequest<mojom::ProcessControl> request) { |
| 591 DVLOG(1) << "GPU: Binding ProcessControl request"; | 593 DVLOG(1) << "GPU: Binding ProcessControl request"; |
| 592 DCHECK(process_control_); | 594 DCHECK(process_control_); |
| 593 process_control_bindings_.AddBinding(process_control_.get(), | 595 process_control_bindings_.AddBinding(process_control_.get(), |
| 594 std::move(request)); | 596 std::move(request)); |
| 595 } | 597 } |
| 596 | 598 |
| 597 } // namespace content | 599 } // namespace content |
| OLD | NEW |