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

Side by Side Diff: base/power_monitor/power_monitor.cc

Issue 877993003: Pass FROM_HERE to ObserverListThreadSafe::Notify to improve profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « base/observer_list_unittest.cc ('k') | base/system_monitor/system_monitor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/power_monitor/power_monitor.h" 5 #include "base/power_monitor/power_monitor.h"
6 #include "base/power_monitor/power_monitor_source.h" 6 #include "base/power_monitor/power_monitor_source.h"
7 7
8 namespace base { 8 namespace base {
9 9
10 static PowerMonitor* g_power_monitor = NULL; 10 static PowerMonitor* g_power_monitor = NULL;
(...skipping 27 matching lines...) Expand all
38 return source_.get(); 38 return source_.get();
39 } 39 }
40 40
41 bool PowerMonitor::IsOnBatteryPower() { 41 bool PowerMonitor::IsOnBatteryPower() {
42 return source_->IsOnBatteryPower(); 42 return source_->IsOnBatteryPower();
43 } 43 }
44 44
45 void PowerMonitor::NotifyPowerStateChange(bool battery_in_use) { 45 void PowerMonitor::NotifyPowerStateChange(bool battery_in_use) {
46 DVLOG(1) << "PowerStateChange: " << (battery_in_use ? "On" : "Off") 46 DVLOG(1) << "PowerStateChange: " << (battery_in_use ? "On" : "Off")
47 << " battery"; 47 << " battery";
48 observers_->Notify(&PowerObserver::OnPowerStateChange, battery_in_use); 48 observers_->Notify(FROM_HERE, &PowerObserver::OnPowerStateChange,
49 battery_in_use);
49 } 50 }
50 51
51 void PowerMonitor::NotifySuspend() { 52 void PowerMonitor::NotifySuspend() {
52 DVLOG(1) << "Power Suspending"; 53 DVLOG(1) << "Power Suspending";
53 observers_->Notify(&PowerObserver::OnSuspend); 54 observers_->Notify(FROM_HERE, &PowerObserver::OnSuspend);
54 } 55 }
55 56
56 void PowerMonitor::NotifyResume() { 57 void PowerMonitor::NotifyResume() {
57 DVLOG(1) << "Power Resuming"; 58 DVLOG(1) << "Power Resuming";
58 observers_->Notify(&PowerObserver::OnResume); 59 observers_->Notify(FROM_HERE, &PowerObserver::OnResume);
59 } 60 }
60 61
61 } // namespace base 62 } // namespace base
OLDNEW
« no previous file with comments | « base/observer_list_unittest.cc ('k') | base/system_monitor/system_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698