| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). | 202 // ChromeBrowserMainPartsAndroid::PreMainMessageLoopRun(). |
| 203 if (!in_browser_process_) | 203 if (!in_browser_process_) |
| 204 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); | 204 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); |
| 205 #endif | 205 #endif |
| 206 // We don't want to process any incoming interface requests until | 206 // We don't want to process any incoming interface requests until |
| 207 // OnInitialize() is invoked. | 207 // OnInitialize() is invoked. |
| 208 GetInterfaceRegistry()->PauseBinding(); | 208 GetInterfaceRegistry()->PauseBinding(); |
| 209 | 209 |
| 210 if (GetContentClient()->gpu()) // NULL in tests. | 210 if (GetContentClient()->gpu()) // NULL in tests. |
| 211 GetContentClient()->gpu()->Initialize(this); | 211 GetContentClient()->gpu()->Initialize(this); |
| 212 channel()->AddAssociatedInterface(base::Bind( |
| 213 &GpuChildThread::CreateGpuMainService, base::Unretained(this))); |
| 212 } | 214 } |
| 213 | 215 |
| 214 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, | 216 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, |
| 215 const std::string& group_name) { | 217 const std::string& group_name) { |
| 216 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); | 218 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); |
| 217 } | 219 } |
| 218 | 220 |
| 221 void GpuChildThread::CreateGpuMainService( |
| 222 ui::mojom::GpuMainAssociatedRequest request) { |
| 223 // TODO(sad): Implement. |
| 224 } |
| 225 |
| 219 bool GpuChildThread::Send(IPC::Message* msg) { | 226 bool GpuChildThread::Send(IPC::Message* msg) { |
| 220 // The GPU process must never send a synchronous IPC message to the browser | 227 // The GPU process must never send a synchronous IPC message to the browser |
| 221 // process. This could result in deadlock. | 228 // process. This could result in deadlock. |
| 222 DCHECK(!msg->is_sync()); | 229 DCHECK(!msg->is_sync()); |
| 223 | 230 |
| 224 return ChildThreadImpl::Send(msg); | 231 return ChildThreadImpl::Send(msg); |
| 225 } | 232 } |
| 226 | 233 |
| 227 bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) { | 234 bool GpuChildThread::OnControlMessageReceived(const IPC::Message& msg) { |
| 228 bool handled = true; | 235 bool handled = true; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 529 |
| 523 void GpuChildThread::BindServiceFactoryRequest( | 530 void GpuChildThread::BindServiceFactoryRequest( |
| 524 service_manager::mojom::ServiceFactoryRequest request) { | 531 service_manager::mojom::ServiceFactoryRequest request) { |
| 525 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; | 532 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; |
| 526 DCHECK(service_factory_); | 533 DCHECK(service_factory_); |
| 527 service_factory_bindings_.AddBinding(service_factory_.get(), | 534 service_factory_bindings_.AddBinding(service_factory_.get(), |
| 528 std::move(request)); | 535 std::move(request)); |
| 529 } | 536 } |
| 530 | 537 |
| 531 } // namespace content | 538 } // namespace content |
| OLD | NEW |