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

Side by Side Diff: services/resource_coordinator/public/cpp/resource_coordinator_interface.h

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Created 3 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_
6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_
7
8 #include <stdint.h>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "services/resource_coordinator/public/interfaces/coordination_unit.mojo m.h"
13
14 namespace service_manager {
15 class Connector;
16 }
17
18 namespace resource_coordinator {
19
20 class ResourceCoordinatorInterface {
21 public:
22 ResourceCoordinatorInterface(service_manager::Connector* connector,
23 const CoordinationUnitType& type);
24 ~ResourceCoordinatorInterface();
25
26 const mojom::CoordinationUnitPtr& service() const { return service_; }
27
28 void SendEvent(const EventType& event_type);
29 void AddChild(const ResourceCoordinatorInterface& child);
30
31 private:
32 void ConnectToService(service_manager::Connector* connector,
33 const CoordinationUnitType& type,
34 const std::string& id);
35 void AddChildByID(const CoordinationUnitID& child_id);
36
37 mojom::CoordinationUnitPtr service_;
38 base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_;
39
40 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface);
41 };
42
43 } // namespace resource_coordinator
44
45 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFA CE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698