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_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_
H_ | 5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_
H_ |
6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_
H_ | 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_
H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using EventType = mojom::EventType; | 21 using EventType = mojom::EventType; |
22 | 22 |
23 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT | 23 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT |
24 ResourceCoordinatorInterface { | 24 ResourceCoordinatorInterface { |
25 public: | 25 public: |
26 ResourceCoordinatorInterface(service_manager::Connector* connector, | 26 ResourceCoordinatorInterface(service_manager::Connector* connector, |
27 const CoordinationUnitType& type); | 27 const CoordinationUnitType& type); |
28 ResourceCoordinatorInterface(service_manager::Connector* connector, | 28 ResourceCoordinatorInterface(service_manager::Connector* connector, |
29 const CoordinationUnitType& type, | 29 const CoordinationUnitType& type, |
30 const std::string& id); | 30 const std::string& id); |
| 31 ResourceCoordinatorInterface(service_manager::Connector* connector, |
| 32 const CoordinationUnitType& type, |
| 33 uint64_t id); |
| 34 |
31 ~ResourceCoordinatorInterface(); | 35 ~ResourceCoordinatorInterface(); |
32 | 36 |
33 const mojom::CoordinationUnitPtr& service() const { return service_; } | 37 const mojom::CoordinationUnitPtr& service() const { return service_; } |
34 | 38 |
35 void SendEvent(const mojom::EventType& event_type); | 39 void SendEvent(const mojom::EventType& event_type); |
36 void AddChild(const ResourceCoordinatorInterface& child); | 40 void AddChild(const ResourceCoordinatorInterface& child); |
37 | 41 |
38 private: | 42 private: |
39 void ConnectToService(service_manager::Connector* connector, | 43 void ConnectToService(service_manager::Connector* connector, |
40 const CoordinationUnitType& type, | 44 const CoordinationUnitID& cu_id); |
41 const std::string& id); | |
42 void AddChildByID(const CoordinationUnitID& child_id); | 45 void AddChildByID(const CoordinationUnitID& child_id); |
43 | 46 |
44 mojom::CoordinationUnitPtr service_; | 47 mojom::CoordinationUnitPtr service_; |
45 | 48 |
46 base::ThreadChecker thread_checker_; | 49 base::ThreadChecker thread_checker_; |
47 | 50 |
48 // The WeakPtrFactory should come last so the weak ptrs are invalidated | 51 // The WeakPtrFactory should come last so the weak ptrs are invalidated |
49 // before the rest of the member variables. | 52 // before the rest of the member variables. |
50 base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_; | 53 base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_; |
51 | 54 |
52 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface); | 55 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface); |
53 }; | 56 }; |
54 | 57 |
55 } // namespace resource_coordinator | 58 } // namespace resource_coordinator |
56 | 59 |
57 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFA
CE_H_ | 60 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFA
CE_H_ |
OLD | NEW |