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/service.h" | 12 #include "services/service_manager/public/cpp/service.h" |
13 #include "services/service_manager/public/cpp/service_context_ref.h" | 13 #include "services/service_manager/public/cpp/service_context_ref.h" |
14 | 14 |
15 namespace shape_detection { | 15 namespace shape_detection { |
16 | 16 |
17 class ShapeDetectionService : public service_manager::Service { | 17 class ShapeDetectionService : public service_manager::Service { |
18 public: | 18 public: |
19 // Factory function for use as an embedded service. | 19 // Factory function for use as an embedded service. |
20 static std::unique_ptr<service_manager::Service> Create(); | 20 static std::unique_ptr<service_manager::Service> Create(); |
21 | 21 |
22 ShapeDetectionService(); | 22 ShapeDetectionService(); |
23 ~ShapeDetectionService() override; | 23 ~ShapeDetectionService() override; |
24 | 24 |
25 void OnStart() override; | 25 void OnStart() override; |
26 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 26 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
27 service_manager::InterfaceRegistry* registry) override; | 27 service_manager::InterfaceRegistry* registry) override; |
28 bool OnStop() override; | |
29 | 28 |
30 private: | 29 private: |
31 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; | 30 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; |
32 | 31 |
33 DISALLOW_COPY_AND_ASSIGN(ShapeDetectionService); | 32 DISALLOW_COPY_AND_ASSIGN(ShapeDetectionService); |
34 }; | 33 }; |
35 | 34 |
36 } // namespace shape_detection | 35 } // namespace shape_detection |
37 | 36 |
38 #endif // SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ | 37 #endif // SERVICES_SHAPE_DETECTION_SHAPE_DETECTION_SERVICE_H_ |
OLD | NEW |