Chromium Code Reviews| Index: services/shape_detection/shape_detection_service.cc |
| diff --git a/services/shape_detection/shape_detection_service.cc b/services/shape_detection/shape_detection_service.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8cd7645b9cb216bd39ef8a7ca8eeca9353d5c27f |
| --- /dev/null |
| +++ b/services/shape_detection/shape_detection_service.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "services/shape_detection/shape_detection_service.h" |
| + |
| +#include "base/macros.h" |
| +#include "mojo/public/cpp/bindings/strong_binding.h" |
| +#include "services/service_manager/public/cpp/interface_registry.h" |
| +#include "services/service_manager/public/cpp/service_context.h" |
| +#include "services/shape_detection/face_detection_impl.h" |
| + |
| +namespace shape_detection { |
| + |
| +std::unique_ptr<service_manager::Service> ShapeDetectionService::Create() { |
| + return base::MakeUnique<ShapeDetectionService>(); |
| +} |
| + |
| +ShapeDetectionService::ShapeDetectionService() = default; |
| + |
| +ShapeDetectionService::~ShapeDetectionService() = default; |
| + |
| +void ShapeDetectionService::OnStart() { |
| + ref_factory_.reset(new service_manager::ServiceContextRefFactory( |
| + base::Bind(&service_manager::ServiceContext::RequestQuit, |
| + base::Unretained(context())))); |
| +} |
| + |
| +bool ShapeDetectionService::OnConnect( |
| + const service_manager::ServiceInfo& remote_info, |
| + service_manager::InterfaceRegistry* registry) { |
| + 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.
|
| + return true; |
| +} |
| + |
| +bool ShapeDetectionService::OnStop() { |
| + return true; |
| +} |
| + |
| +} // namespace shape_detection |