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

Side by Side Diff: services/resource_coordinator/coordination_unit/coordination_unit_manager.h

Issue 2926663003: [GRC] Coordination Unit Graph Observer (Closed)
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
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 #include "services/service_manager/public/cpp/binder_registry.h" 12 #include "services/service_manager/public/cpp/binder_registry.h"
10 13
11 namespace service_manager { 14 namespace service_manager {
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);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698