OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ | 5 #ifndef SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ |
6 #define SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ | 6 #define SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "services/service_manager/public/cpp/binder_registry.h" |
12 #include "services/service_manager/public/cpp/service.h" | 13 #include "services/service_manager/public/cpp/service.h" |
13 #include "services/service_manager/public/cpp/service_context_ref.h" | 14 #include "services/service_manager/public/cpp/service_context_ref.h" |
14 | 15 |
15 namespace shape_detection { | 16 namespace shape_detection { |
16 | 17 |
17 class ShapeDetectionService : public service_manager::Service { | 18 class ShapeDetectionService : public service_manager::Service { |
18 public: | 19 public: |
19 // Factory function for use as an embedded service. | 20 // Factory function for use as an embedded service. |
20 static std::unique_ptr<service_manager::Service> Create(); | 21 static std::unique_ptr<service_manager::Service> Create(); |
21 | 22 |
22 ShapeDetectionService(); | 23 ShapeDetectionService(); |
23 ~ShapeDetectionService() override; | 24 ~ShapeDetectionService() override; |
24 | 25 |
25 void OnStart() override; | 26 void OnStart() override; |
26 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 27 void OnBindInterface(const service_manager::ServiceInfo& source_info, |
27 service_manager::InterfaceRegistry* registry) override; | 28 const std::string& interface_name, |
| 29 mojo::ScopedMessagePipeHandle interface_pipe) override; |
28 | 30 |
29 private: | 31 private: |
30 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; | 32 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; |
| 33 service_manager::BinderRegistry registry_; |
31 | 34 |
32 DISALLOW_COPY_AND_ASSIGN(ShapeDetectionService); | 35 DISALLOW_COPY_AND_ASSIGN(ShapeDetectionService); |
33 }; | 36 }; |
34 | 37 |
35 } // namespace shape_detection | 38 } // namespace shape_detection |
36 | 39 |
37 #endif // SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ | 40 #endif // SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ |
OLD | NEW |