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