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

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

Issue 2926663003: [GRC] Coordination Unit Graph Observer (Closed)
Patch Set: Address review feedback 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..0907d05e2a52a32fe9176d8586f6719268d356ed 100644
--- a/services/resource_coordinator/coordination_unit/coordination_unit_manager.h
+++ b/services/resource_coordinator/coordination_unit/coordination_unit_manager.h
@@ -5,6 +5,9 @@
#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGER_H_
#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_MANAGER_H_
+#include <memory>
+#include <vector>
+
#include "base/macros.h"
namespace service_manager {
@@ -14,6 +17,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 +31,17 @@ class CoordinationUnitManager {
void OnStart(service_manager::BinderRegistry* registry,
service_manager::ServiceContextRefFactory* service_ref_factory);
+ void RegisterObserver(
+ 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.
+
+ void NotifyObserversCoordinationUnitCreated(
+ CoordinationUnitImpl* coordination_unit);
+ void NotifyObserversCoordinationUnitWillBeDestroyed(
+ CoordinationUnitImpl* coordination_unit);
private:
+ std::vector<std::unique_ptr<CoordinationUnitGraphObserver>> observers_;
+
static void Create(
service_manager::ServiceContextRefFactory* service_ref_factory);

Powered by Google App Engine
This is Rietveld 408576698