| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). | 229 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). |
| 230 if (!in_browser_process_) | 230 if (!in_browser_process_) |
| 231 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); | 231 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); |
| 232 #endif | 232 #endif |
| 233 | 233 |
| 234 // Only set once per process instance. | 234 // Only set once per process instance. |
| 235 process_control_.reset(new GpuProcessControlImpl()); | 235 process_control_.reset(new GpuProcessControlImpl()); |
| 236 | 236 |
| 237 // Use of base::Unretained(this) is safe here because |service_registry()| | 237 // Use of base::Unretained(this) is safe here because |service_registry()| |
| 238 // will be destroyed before GpuChildThread is destructed. | 238 // will be destroyed before GpuChildThread is destructed. |
| 239 service_registry()->AddService(base::Bind( | 239 interface_registry()->AddInterface(base::Bind( |
| 240 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); | 240 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); |
| 241 | 241 |
| 242 if (GetContentClient()->gpu()) { // NULL in tests. | 242 if (GetContentClient()->gpu()) { // NULL in tests. |
| 243 GetContentClient()->gpu()->Initialize(this); | 243 GetContentClient()->gpu()->Initialize(this); |
| 244 GetContentClient()->gpu()->RegisterMojoServices(service_registry()); | 244 GetContentClient()->gpu()->RegisterMojoInterfaces(interface_registry()); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, | 248 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, |
| 249 const std::string& group_name) { | 249 const std::string& group_name) { |
| 250 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); | 250 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool GpuChildThread::Send(IPC::Message* msg) { | 253 bool GpuChildThread::Send(IPC::Message* msg) { |
| 254 // The GPU process must never send a synchronous IPC message to the browser | 254 // The GPU process must never send a synchronous IPC message to the browser |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 570 |
| 571 void GpuChildThread::BindProcessControlRequest( | 571 void GpuChildThread::BindProcessControlRequest( |
| 572 mojo::InterfaceRequest<mojom::ProcessControl> request) { | 572 mojo::InterfaceRequest<mojom::ProcessControl> request) { |
| 573 DVLOG(1) << "GPU: Binding ProcessControl request"; | 573 DVLOG(1) << "GPU: Binding ProcessControl request"; |
| 574 DCHECK(process_control_); | 574 DCHECK(process_control_); |
| 575 process_control_bindings_.AddBinding(process_control_.get(), | 575 process_control_bindings_.AddBinding(process_control_.get(), |
| 576 std::move(request)); | 576 std::move(request)); |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace content | 579 } // namespace content |
| OLD | NEW |