Index: services/resource_coordinator/coordination_unit/coordination_unit_manager.h |
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_manager.h b/services/resource_coordinator/coordination_unit/coordination_unit_manager.h |
index 7d07f8bbdf5f2140bde0018f9d7a3bb46daa57d4..8d2900b367b992aa27477f04bb182c8f3ccf788d 100644 |
--- a/services/resource_coordinator/coordination_unit/coordination_unit_manager.h |
+++ b/services/resource_coordinator/coordination_unit/coordination_unit_manager.h |
@@ -5,6 +5,8 @@ |
#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGER_H_ |
#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGER_H_ |
+#include <vector> |
+ |
#include "base/macros.h" |
namespace service_manager { |
@@ -14,6 +16,9 @@ class ServiceContextRefFactory; |
namespace resource_coordinator { |
+class CoordinationUnitImpl; |
+class CoordinationUnitGraphObserver; |
+ |
// The CoordinationUnitManager is a singleton that encapsulates all |
// aspects of Coordination Units within the ResourceCoordinatorService. |
// All functionality for dealing with CoordinationUnits should be contained |
@@ -25,8 +30,20 @@ class CoordinationUnitManager { |
void OnStart(service_manager::BinderRegistry* registry, |
service_manager::ServiceContextRefFactory* service_ref_factory); |
+ void RegisterObserver(CoordinationUnitGraphObserver* observers); |
+ |
+ void NotifyObserversCoordinationUnitCreated( |
+ CoordinationUnitImpl* coordination_unit); |
+ void NotifyObserversCoordinationUnitWillBeDestroyed( |
+ CoordinationUnitImpl* coordination_unit); |
+ |
+ // Allow tests to clear all observers so that they can isolate specific |
+ // observers without having to worry about side effects from others. |
+ void UnregisterAllObserversForTesting(); |
private: |
+ std::vector<CoordinationUnitGraphObserver*> observers_; |
zhenw
2017/06/13 18:38:41
Any reason not to use unique_ptr here?
If filter
|
+ |
static void Create( |
service_manager::ServiceContextRefFactory* service_ref_factory); |