Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |