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

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

Issue 2925123002: NOCOMMIT PROTOTYPE [GRC] Tab CPU Usage 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_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_ 5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_
6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_ 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFACE_ H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 const CoordinationUnitType& type, 34 const CoordinationUnitType& type,
35 uint64_t id); 35 uint64_t id);
36 36
37 ~ResourceCoordinatorInterface(); 37 ~ResourceCoordinatorInterface();
38 38
39 const mojom::CoordinationUnitPtr& service() const { return service_; } 39 const mojom::CoordinationUnitPtr& service() const { return service_; }
40 40
41 void SendEvent(const mojom::EventType& event_type); 41 void SendEvent(const mojom::EventType& event_type);
42 void AddChild(const ResourceCoordinatorInterface& child); 42 void AddChild(const ResourceCoordinatorInterface& child);
43 void RemoveChild(const ResourceCoordinatorInterface& child); 43 void RemoveChild(const ResourceCoordinatorInterface& child);
44 void SetProperty(const mojom::PropertyType key, const base::Value& value);
44 45
45 private: 46 private:
46 void ConnectToService(service_manager::Connector* connector, 47 void ConnectToService(service_manager::Connector* connector,
47 const CoordinationUnitID& cu_id); 48 const CoordinationUnitID& cu_id);
48 void AddChildByID(const CoordinationUnitID& child_id); 49 void AddChildByID(const CoordinationUnitID& child_id);
49 void RemoveChildByID(const CoordinationUnitID& child_id); 50 void RemoveChildByID(const CoordinationUnitID& child_id);
50 51
51 mojom::CoordinationUnitPtr service_; 52 mojom::CoordinationUnitPtr service_;
52 53
53 base::ThreadChecker thread_checker_; 54 base::ThreadChecker thread_checker_;
54 55
55 // The WeakPtrFactory should come last so the weak ptrs are invalidated 56 // The WeakPtrFactory should come last so the weak ptrs are invalidated
56 // before the rest of the member variables. 57 // before the rest of the member variables.
57 base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_; 58 base::WeakPtrFactory<ResourceCoordinatorInterface> weak_ptr_factory_;
58 59
59 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface); 60 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorInterface);
60 }; 61 };
61 62
62 } // namespace resource_coordinator 63 } // namespace resource_coordinator
63 64
64 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFA CE_H_ 65 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_RESOURCE_COORDINATOR_INTERFA CE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698