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

Side by Side Diff: chrome/browser/power_usage_monitor/power_usage_monitor.cc

Issue 2524733003: Rename 'interface' parameter (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/power_usage_monitor/power_usage_monitor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/power_usage_monitor/power_usage_monitor.h" 5 #include "chrome/browser/power_usage_monitor/power_usage_monitor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 if (live_renderer_ids_.empty() && previous_num_live_renderers != 0) { 223 if (live_renderer_ids_.empty() && previous_num_live_renderers != 0) {
224 // All render processes have died. 224 // All render processes have died.
225 CancelPendingHistogramReporting(); 225 CancelPendingHistogramReporting();
226 tracking_discharge_ = false; 226 tracking_discharge_ = false;
227 } 227 }
228 } 228 }
229 229
230 void PowerUsageMonitor::SetSystemInterfaceForTest( 230 void PowerUsageMonitor::SetSystemInterfaceForTest(
231 std::unique_ptr<SystemInterface> interface) { 231 std::unique_ptr<SystemInterface> system_interface) {
232 system_interface_ = std::move(interface); 232 system_interface_ = std::move(system_interface);
233 } 233 }
234 234
235 void PowerUsageMonitor::OnPowerStateChange(bool on_battery_power) {} 235 void PowerUsageMonitor::OnPowerStateChange(bool on_battery_power) {}
236 236
237 void PowerUsageMonitor::OnResume() {} 237 void PowerUsageMonitor::OnResume() {}
238 238
239 void PowerUsageMonitor::OnSuspend() { 239 void PowerUsageMonitor::OnSuspend() {
240 CancelPendingHistogramReporting(); 240 CancelPendingHistogramReporting();
241 } 241 }
242 242
243 void PowerUsageMonitor::Observe(int type, 243 void PowerUsageMonitor::Observe(int type,
244 const content::NotificationSource& source, 244 const content::NotificationSource& source,
245 const content::NotificationDetails& details) { 245 const content::NotificationDetails& details) {
246 content::RenderProcessHost* rph = 246 content::RenderProcessHost* rph =
247 content::Source<content::RenderProcessHost>(source).ptr(); 247 content::Source<content::RenderProcessHost>(source).ptr();
248 OnRenderProcessNotification(type, rph->GetID()); 248 OnRenderProcessNotification(type, rph->GetID());
249 } 249 }
250 250
251 void PowerUsageMonitor::CancelPendingHistogramReporting() { 251 void PowerUsageMonitor::CancelPendingHistogramReporting() {
252 // Cancel any in-progress histogram reports and reporting of discharge UMA. 252 // Cancel any in-progress histogram reports and reporting of discharge UMA.
253 system_interface_->CancelPendingHistogramReports(); 253 system_interface_->CancelPendingHistogramReports();
254 } 254 }
OLDNEW
« no previous file with comments | « chrome/browser/power_usage_monitor/power_usage_monitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698