Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: content/utility/utility_service_factory.cc

Issue 2900583002: Revert of [Mojo Video Capture] Hook up video capture service behind a feature flag (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/utility/DEPS ('k') | media/capture/video/video_capture_system.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/utility/utility_service_factory.h" 5 #include "content/utility/utility_service_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/child/child_process.h" 9 #include "content/child/child_process.h"
10 #include "content/network/network_service.h" 10 #include "content/network/network_service.h"
11 #include "content/public/common/content_client.h" 11 #include "content/public/common/content_client.h"
12 #include "content/public/common/content_switches.h" 12 #include "content/public/common/content_switches.h"
13 #include "content/public/common/service_names.mojom.h" 13 #include "content/public/common/service_names.mojom.h"
14 #include "content/public/utility/content_utility_client.h" 14 #include "content/public/utility/content_utility_client.h"
15 #include "content/public/utility/utility_thread.h" 15 #include "content/public/utility/utility_thread.h"
16 #include "content/utility/utility_thread_impl.h" 16 #include "content/utility/utility_thread_impl.h"
17 #include "media/mojo/features.h" 17 #include "media/mojo/features.h"
18 #include "services/data_decoder/data_decoder_service.h" 18 #include "services/data_decoder/data_decoder_service.h"
19 #include "services/data_decoder/public/interfaces/constants.mojom.h" 19 #include "services/data_decoder/public/interfaces/constants.mojom.h"
20 #include "services/shape_detection/public/interfaces/constants.mojom.h" 20 #include "services/shape_detection/public/interfaces/constants.mojom.h"
21 #include "services/shape_detection/shape_detection_service.h" 21 #include "services/shape_detection/shape_detection_service.h"
22 #include "services/video_capture/public/interfaces/constants.mojom.h"
23 #include "services/video_capture/service_impl.h"
24 22
25 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) 23 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
26 #include "media/mojo/services/media_service_factory.h" // nogncheck 24 #include "media/mojo/services/media_service_factory.h" // nogncheck
27 #endif 25 #endif
28 26
29 namespace {
30
31 std::unique_ptr<service_manager::Service> CreateVideoCaptureService() {
32 return base::MakeUnique<video_capture::ServiceImpl>();
33 }
34
35 } // anonymous namespace
36
37 namespace content { 27 namespace content {
38 28
39 namespace { 29 namespace {
40 30
41 std::unique_ptr<service_manager::Service> CreateDataDecoderService() { 31 std::unique_ptr<service_manager::Service> CreateDataDecoderService() {
42 content::UtilityThread::Get()->EnsureBlinkInitialized(); 32 content::UtilityThread::Get()->EnsureBlinkInitialized();
43 return data_decoder::DataDecoderService::Create(); 33 return data_decoder::DataDecoderService::Create();
44 } 34 }
45 35
46 } // namespace 36 } // namespace
47 37
48 UtilityServiceFactory::UtilityServiceFactory() 38 UtilityServiceFactory::UtilityServiceFactory()
49 : network_registry_(base::MakeUnique<service_manager::BinderRegistry>()) {} 39 : network_registry_(base::MakeUnique<service_manager::BinderRegistry>()) {}
50 40
51 UtilityServiceFactory::~UtilityServiceFactory() {} 41 UtilityServiceFactory::~UtilityServiceFactory() {}
52 42
53 void UtilityServiceFactory::RegisterServices(ServiceMap* services) { 43 void UtilityServiceFactory::RegisterServices(ServiceMap* services) {
54 GetContentClient()->utility()->RegisterServices(services); 44 GetContentClient()->utility()->RegisterServices(services);
55 45
56 ServiceInfo video_capture_info;
57 video_capture_info.factory = base::Bind(&CreateVideoCaptureService);
58 services->insert(
59 std::make_pair(video_capture::mojom::kServiceName, video_capture_info));
60
61 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) 46 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
62 ServiceInfo info; 47 ServiceInfo info;
63 info.factory = base::Bind(&media::CreateMediaService); 48 info.factory = base::Bind(&media::CreateMediaService);
64 services->insert(std::make_pair("media", info)); 49 services->insert(std::make_pair("media", info));
65 #endif 50 #endif
66 51
67 ServiceInfo shape_detection_info; 52 ServiceInfo shape_detection_info;
68 shape_detection_info.factory = 53 shape_detection_info.factory =
69 base::Bind(&shape_detection::ShapeDetectionService::Create); 54 base::Bind(&shape_detection::ShapeDetectionService::Create);
70 services->insert(std::make_pair(shape_detection::mojom::kServiceName, 55 services->insert(std::make_pair(shape_detection::mojom::kServiceName,
(...skipping 27 matching lines...) Expand all
98 utility_thread->Shutdown(); 83 utility_thread->Shutdown();
99 utility_thread->ReleaseProcessIfNeeded(); 84 utility_thread->ReleaseProcessIfNeeded();
100 } 85 }
101 86
102 std::unique_ptr<service_manager::Service> 87 std::unique_ptr<service_manager::Service>
103 UtilityServiceFactory::CreateNetworkService() { 88 UtilityServiceFactory::CreateNetworkService() {
104 return base::MakeUnique<NetworkService>(std::move(network_registry_)); 89 return base::MakeUnique<NetworkService>(std::move(network_registry_));
105 } 90 }
106 91
107 } // namespace content 92 } // namespace content
OLDNEW
« no previous file with comments | « content/utility/DEPS ('k') | media/capture/video/video_capture_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698