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

Unified Diff: base/power_monitor/power_observer.h

Issue 502003003: Check to ensure PowerObservers are added and removed on the same thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switched to using ThreadChecker Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/power_monitor/power_monitor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/power_monitor/power_observer.h
diff --git a/base/power_monitor/power_observer.h b/base/power_monitor/power_observer.h
index 6be70bba9d5368dfa0cf7a4f145247a1334430ec..935217ef103576e1785e84b431ef9380ed3905c7 100644
--- a/base/power_monitor/power_observer.h
+++ b/base/power_monitor/power_observer.h
@@ -7,14 +7,18 @@
#include "base/base_export.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/threading/thread_checker.h"
namespace base {
class BASE_EXPORT PowerObserver {
+ friend class PowerMonitor;
+
public:
// Notification of a change in power status of the computer, such
// as from switching between battery and A/C power.
- virtual void OnPowerStateChange(bool on_battery_power) {};
+ virtual void OnPowerStateChange(bool on_battery_power) {}
// Notification that the system is suspending.
virtual void OnSuspend() {}
@@ -24,6 +28,8 @@ class BASE_EXPORT PowerObserver {
protected:
virtual ~PowerObserver() {}
+
+ scoped_ptr<base::ThreadChecker> thread_checker_;
brettw 2014/08/26 18:03:34 A lot of stuff derives from this class. Having thi
};
} // namespace base
« no previous file with comments | « base/power_monitor/power_monitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698