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

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

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 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac e.h" 5 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac e.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "mojo/public/cpp/bindings/binding.h" 9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "services/resource_coordinator/public/interfaces/coordination_unit_prov ider.mojom.h" 10 #include "services/resource_coordinator/public/interfaces/coordination_unit_prov ider.mojom.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 base::Bind(&ResourceCoordinatorInterface::RemoveChildByID, 94 base::Bind(&ResourceCoordinatorInterface::RemoveChildByID,
95 weak_ptr_factory_.GetWeakPtr())); 95 weak_ptr_factory_.GetWeakPtr()));
96 } 96 }
97 97
98 void ResourceCoordinatorInterface::RemoveChildByID( 98 void ResourceCoordinatorInterface::RemoveChildByID(
99 const CoordinationUnitID& child_id) { 99 const CoordinationUnitID& child_id) {
100 DCHECK(thread_checker_.CalledOnValidThread()); 100 DCHECK(thread_checker_.CalledOnValidThread());
101 service_->RemoveChild(child_id); 101 service_->RemoveChild(child_id);
102 } 102 }
103 103
104 void ResourceCoordinatorInterface::SetProperty(
105 const mojom::PropertyType property_name,
106 const base::Value& value) {
107 DCHECK(thread_checker_.CalledOnValidThread());
108 mojom::PropertyPtr property = mojom::Property::New();
109 property->property = property_name;
110 property->value = base::MakeUnique<base::Value>(value);
111 service_->SetProperty(std::move(property));
112 }
113
104 } // namespace resource_coordinator 114 } // namespace resource_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698