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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). | 215 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). |
216 if (!in_browser_process_) | 216 if (!in_browser_process_) |
217 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); | 217 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); |
218 #endif | 218 #endif |
219 | 219 |
220 // Only set once per process instance. | 220 // Only set once per process instance. |
221 process_control_.reset(new GpuProcessControlImpl()); | 221 process_control_.reset(new GpuProcessControlImpl()); |
222 | 222 |
223 // Use of base::Unretained(this) is safe here because |service_registry()| | 223 // Use of base::Unretained(this) is safe here because |service_registry()| |
224 // will be destroyed before GpuChildThread is destructed. | 224 // will be destroyed before GpuChildThread is destructed. |
225 interface_registry()->AddInterface(base::Bind( | 225 GetInterfaceRegistry()->AddInterface(base::Bind( |
226 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); | 226 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); |
227 | 227 |
228 if (GetContentClient()->gpu()) { // NULL in tests. | 228 if (GetContentClient()->gpu()) { // NULL in tests. |
229 GetContentClient()->gpu()->Initialize(this); | 229 GetContentClient()->gpu()->Initialize(this); |
230 GetContentClient()->gpu()->RegisterMojoInterfaces(interface_registry()); | 230 GetContentClient()->gpu()->ExposeInterfacesToBrowser( |
| 231 GetInterfaceRegistry()); |
231 } | 232 } |
232 } | 233 } |
233 | 234 |
234 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, | 235 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, |
235 const std::string& group_name) { | 236 const std::string& group_name) { |
236 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); | 237 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); |
237 } | 238 } |
238 | 239 |
239 bool GpuChildThread::Send(IPC::Message* msg) { | 240 bool GpuChildThread::Send(IPC::Message* msg) { |
240 // The GPU process must never send a synchronous IPC message to the browser | 241 // 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... |
556 | 557 |
557 void GpuChildThread::BindProcessControlRequest( | 558 void GpuChildThread::BindProcessControlRequest( |
558 mojo::InterfaceRequest<mojom::ProcessControl> request) { | 559 mojo::InterfaceRequest<mojom::ProcessControl> request) { |
559 DVLOG(1) << "GPU: Binding ProcessControl request"; | 560 DVLOG(1) << "GPU: Binding ProcessControl request"; |
560 DCHECK(process_control_); | 561 DCHECK(process_control_); |
561 process_control_bindings_.AddBinding(process_control_.get(), | 562 process_control_bindings_.AddBinding(process_control_.get(), |
562 std::move(request)); | 563 std::move(request)); |
563 } | 564 } |
564 | 565 |
565 } // namespace content | 566 } // namespace content |
OLD | NEW |