OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_service_factory.h" | 5 #include "content/gpu/gpu_service_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "services/shape_detection/public/interfaces/constants.mojom.h" | |
11 #include "services/shape_detection/shape_detection_service.h" | |
12 | 10 |
13 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 11 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
14 #include "base/bind.h" | 12 #include "base/bind.h" |
15 #include "media/mojo/services/media_service_factory.h" // nogncheck | 13 #include "media/mojo/services/media_service_factory.h" // nogncheck |
16 #endif | 14 #endif |
17 | 15 |
18 namespace content { | 16 namespace content { |
19 | 17 |
20 GpuServiceFactory::GpuServiceFactory( | 18 GpuServiceFactory::GpuServiceFactory( |
21 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager) { | 19 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager) { |
22 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 20 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
23 task_runner_ = base::ThreadTaskRunnerHandle::Get(); | 21 task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
24 media_gpu_channel_manager_ = std::move(media_gpu_channel_manager); | 22 media_gpu_channel_manager_ = std::move(media_gpu_channel_manager); |
25 #endif | 23 #endif |
26 } | 24 } |
27 | 25 |
28 GpuServiceFactory::~GpuServiceFactory() {} | 26 GpuServiceFactory::~GpuServiceFactory() {} |
29 | 27 |
30 void GpuServiceFactory::RegisterServices(ServiceMap* services) { | 28 void GpuServiceFactory::RegisterServices(ServiceMap* services) { |
31 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 29 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
32 ServiceInfo info; | 30 ServiceInfo info; |
33 info.factory = base::Bind(&media::CreateGpuMediaService, task_runner_, | 31 info.factory = base::Bind(&media::CreateGpuMediaService, task_runner_, |
34 media_gpu_channel_manager_); | 32 media_gpu_channel_manager_); |
35 info.use_own_thread = true; | 33 info.use_own_thread = true; |
36 services->insert(std::make_pair("media", info)); | 34 services->insert(std::make_pair("media", info)); |
37 #endif | 35 #endif |
38 | |
39 ServiceInfo shape_detection_info; | |
40 shape_detection_info.factory = | |
41 base::Bind(&shape_detection::ShapeDetectionService::Create); | |
42 services->insert(std::make_pair(shape_detection::mojom::kServiceName, | |
43 shape_detection_info)); | |
44 } | 36 } |
45 | 37 |
46 } // namespace content | 38 } // namespace content |
OLD | NEW |