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_COORDINATION_UNIT_COORDINATION_UNIT_MANAGE R_H_ | 5 #ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGE R_H_ |
6 #define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGE R_H_ | 6 #define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGE R_H_ |
7 | 7 |
8 #include <memory> | |
9 #include <vector> | |
10 | |
8 #include "base/macros.h" | 11 #include "base/macros.h" |
9 | 12 |
10 namespace service_manager { | 13 namespace service_manager { |
11 class BinderRegistry; | 14 class BinderRegistry; |
12 class ServiceContextRefFactory; | 15 class ServiceContextRefFactory; |
13 } // service_manager | 16 } // service_manager |
14 | 17 |
15 namespace resource_coordinator { | 18 namespace resource_coordinator { |
16 | 19 |
20 class CoordinationUnitImpl; | |
21 class CoordinationUnitGraphObserver; | |
22 | |
17 // The CoordinationUnitManager is a singleton that encapsulates all | 23 // The CoordinationUnitManager is a singleton that encapsulates all |
18 // aspects of Coordination Units within the ResourceCoordinatorService. | 24 // aspects of Coordination Units within the ResourceCoordinatorService. |
19 // All functionality for dealing with CoordinationUnits should be contained | 25 // All functionality for dealing with CoordinationUnits should be contained |
20 // within this class or classes that are owned by it | 26 // within this class or classes that are owned by it |
21 class CoordinationUnitManager { | 27 class CoordinationUnitManager { |
22 public: | 28 public: |
23 CoordinationUnitManager(); | 29 CoordinationUnitManager(); |
24 ~CoordinationUnitManager(); | 30 ~CoordinationUnitManager(); |
25 | 31 |
26 void OnStart(service_manager::BinderRegistry* registry, | 32 void OnStart(service_manager::BinderRegistry* registry, |
27 service_manager::ServiceContextRefFactory* service_ref_factory); | 33 service_manager::ServiceContextRefFactory* service_ref_factory); |
34 void RegisterObserver( | |
35 std::unique_ptr<CoordinationUnitGraphObserver> observers); | |
ducbui
2017/06/19 04:09:15
Maybe a typo? I think "observers" should be "obser
matthalp
2017/06/19 04:18:12
Yes -- thank you for catching this.
| |
36 | |
37 void NotifyObserversCoordinationUnitCreated( | |
38 CoordinationUnitImpl* coordination_unit); | |
39 void NotifyObserversCoordinationUnitWillBeDestroyed( | |
40 CoordinationUnitImpl* coordination_unit); | |
28 | 41 |
29 private: | 42 private: |
43 std::vector<std::unique_ptr<CoordinationUnitGraphObserver>> observers_; | |
44 | |
30 static void Create( | 45 static void Create( |
31 service_manager::ServiceContextRefFactory* service_ref_factory); | 46 service_manager::ServiceContextRefFactory* service_ref_factory); |
32 | 47 |
33 DISALLOW_COPY_AND_ASSIGN(CoordinationUnitManager); | 48 DISALLOW_COPY_AND_ASSIGN(CoordinationUnitManager); |
34 }; | 49 }; |
35 | 50 |
36 } // namespace resource_coordinator | 51 } // namespace resource_coordinator |
37 | 52 |
38 #endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MAN AGER_H_ | 53 #endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MAN AGER_H_ |
OLD | NEW |