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

Side by Side Diff: services/shape_detection/shape_detection_service.cc

Issue 2528743002: Shape Detection: Implement FaceDetection on Mac as out-of-process service (Closed)
Patch Set: Add explanatory comments, rebase Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/shape_detection/shape_detection_service.h"
6
7 #include "base/macros.h"
8 #include "mojo/public/cpp/bindings/strong_binding.h"
9 #include "services/service_manager/public/cpp/interface_registry.h"
10 #include "services/service_manager/public/cpp/service_context.h"
11 #include "services/shape_detection/face_detection_impl.h"
12
13 namespace shape_detection {
14
15 std::unique_ptr<service_manager::Service> ShapeDetectionService::Create() {
16 return base::MakeUnique<ShapeDetectionService>();
17 }
18
19 ShapeDetectionService::ShapeDetectionService() = default;
20
21 ShapeDetectionService::~ShapeDetectionService() = default;
22
23 void ShapeDetectionService::OnStart() {
24 ref_factory_.reset(new service_manager::ServiceContextRefFactory(
25 base::Bind(&service_manager::ServiceContext::RequestQuit,
26 base::Unretained(context()))));
27 }
28
29 bool ShapeDetectionService::OnConnect(
30 const service_manager::ServiceInfo& remote_info,
31 service_manager::InterfaceRegistry* registry) {
32 registry->AddInterface(base::Bind(&FaceDetectionImpl::Create));
Ken Rockot(use gerrit already) 2016/12/05 20:56:52 While I would like to avoid every service needing
xianglu 2016/12/05 22:13:22 Done.
33 return true;
34 }
35
36 bool ShapeDetectionService::OnStop() {
37 return true;
38 }
39
40 } // namespace shape_detection
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698