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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 gpu_preferences, this, watchdog_thread_.get(), | 352 gpu_preferences, this, watchdog_thread_.get(), |
353 base::ThreadTaskRunnerHandle::Get().get(), | 353 base::ThreadTaskRunnerHandle::Get().get(), |
354 ChildProcess::current()->io_task_runner(), | 354 ChildProcess::current()->io_task_runner(), |
355 ChildProcess::current()->GetShutDownEvent(), sync_point_manager, | 355 ChildProcess::current()->GetShutDownEvent(), sync_point_manager, |
356 gpu_memory_buffer_factory_)); | 356 gpu_memory_buffer_factory_)); |
357 | 357 |
358 media_gpu_channel_manager_.reset( | 358 media_gpu_channel_manager_.reset( |
359 new media::MediaGpuChannelManager(gpu_channel_manager_.get())); | 359 new media::MediaGpuChannelManager(gpu_channel_manager_.get())); |
360 | 360 |
361 // Only set once per process instance. | 361 // Only set once per process instance. |
362 service_factory_.reset(new GpuServiceFactory); | 362 service_factory_.reset( |
| 363 new GpuServiceFactory(media_gpu_channel_manager_->AsWeakPtr())); |
363 | 364 |
364 GetInterfaceRegistry()->AddInterface(base::Bind( | 365 GetInterfaceRegistry()->AddInterface(base::Bind( |
365 &GpuChildThread::BindServiceFactoryRequest, base::Unretained(this))); | 366 &GpuChildThread::BindServiceFactoryRequest, base::Unretained(this))); |
366 | 367 |
367 if (GetContentClient()->gpu()) { // NULL in tests. | 368 if (GetContentClient()->gpu()) { // NULL in tests. |
368 GetContentClient()->gpu()->ExposeInterfacesToBrowser(GetInterfaceRegistry(), | 369 GetContentClient()->gpu()->ExposeInterfacesToBrowser(GetInterfaceRegistry(), |
369 gpu_preferences); | 370 gpu_preferences); |
370 GetContentClient()->gpu()->ConsumeInterfacesFromBrowser( | 371 GetContentClient()->gpu()->ConsumeInterfacesFromBrowser( |
371 GetRemoteInterfaces()); | 372 GetRemoteInterfaces()); |
372 } | 373 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 524 |
524 void GpuChildThread::BindServiceFactoryRequest( | 525 void GpuChildThread::BindServiceFactoryRequest( |
525 service_manager::mojom::ServiceFactoryRequest request) { | 526 service_manager::mojom::ServiceFactoryRequest request) { |
526 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; | 527 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; |
527 DCHECK(service_factory_); | 528 DCHECK(service_factory_); |
528 service_factory_bindings_.AddBinding(service_factory_.get(), | 529 service_factory_bindings_.AddBinding(service_factory_.get(), |
529 std::move(request)); | 530 std::move(request)); |
530 } | 531 } |
531 | 532 |
532 } // namespace content | 533 } // namespace content |
OLD | NEW |