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

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

Issue 2528743002: Shape Detection: Implement FaceDetection on Mac as out-of-process service (Closed)
Patch Set: Rebase Created 3 years, 11 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') | services/service_manager/public/cpp/connector.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 "content/public/common/content_client.h" 8 #include "content/public/common/content_client.h"
9 #include "content/public/utility/content_utility_client.h" 9 #include "content/public/utility/content_utility_client.h"
10 #include "content/public/utility/utility_thread.h" 10 #include "content/public/utility/utility_thread.h"
11 #include "content/utility/utility_thread_impl.h" 11 #include "content/utility/utility_thread_impl.h"
12 #include "services/shape_detection/public/interfaces/constants.mojom.h"
13 #include "services/shape_detection/shape_detection_service.h"
12 14
13 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) 15 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
14 #include "media/mojo/services/media_service_factory.h" // nogncheck 16 #include "media/mojo/services/media_service_factory.h" // nogncheck
15 #endif 17 #endif
16 18
17 namespace content { 19 namespace content {
18 20
19 UtilityServiceFactory::UtilityServiceFactory() {} 21 UtilityServiceFactory::UtilityServiceFactory() {}
20 22
21 UtilityServiceFactory::~UtilityServiceFactory() {} 23 UtilityServiceFactory::~UtilityServiceFactory() {}
22 24
23 void UtilityServiceFactory::RegisterServices(ServiceMap* services) { 25 void UtilityServiceFactory::RegisterServices(ServiceMap* services) {
24 GetContentClient()->utility()->RegisterServices(services); 26 GetContentClient()->utility()->RegisterServices(services);
25 27
26 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) 28 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
27 ServiceInfo info; 29 ServiceInfo info;
28 info.factory = base::Bind(&media::CreateMediaService); 30 info.factory = base::Bind(&media::CreateMediaService);
29 services->insert(std::make_pair("media", info)); 31 services->insert(std::make_pair("media", info));
30 #endif 32 #endif
33 ServiceInfo shape_detection_info;
34 shape_detection_info.factory =
35 base::Bind(&shape_detection::ShapeDetectionService::Create);
36 services->insert(std::make_pair(shape_detection::mojom::kServiceName,
37 shape_detection_info));
31 } 38 }
32 39
33 void UtilityServiceFactory::OnServiceQuit() { 40 void UtilityServiceFactory::OnServiceQuit() {
34 UtilityThread::Get()->ReleaseProcessIfNeeded(); 41 UtilityThread::Get()->ReleaseProcessIfNeeded();
35 } 42 }
36 43
37 void UtilityServiceFactory::OnLoadFailed() { 44 void UtilityServiceFactory::OnLoadFailed() {
38 UtilityThreadImpl* utility_thread = 45 UtilityThreadImpl* utility_thread =
39 static_cast<UtilityThreadImpl*>(UtilityThread::Get()); 46 static_cast<UtilityThreadImpl*>(UtilityThread::Get());
40 utility_thread->Shutdown(); 47 utility_thread->Shutdown();
41 utility_thread->ReleaseProcessIfNeeded(); 48 utility_thread->ReleaseProcessIfNeeded();
42 } 49 }
43 50
44 } // namespace content 51 } // namespace content
OLDNEW
« no previous file with comments | « content/utility/DEPS ('k') | services/service_manager/public/cpp/connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698