Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: services/resource_coordinator/coordination_unit/coordination_unit_manager.h

Issue 2926663003: [GRC] Coordination Unit Graph Observer (Closed)
Patch Set: Fix comment typo Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698