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

Unified Diff: content/browser/browser_main_loop.cc

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored to a more explicitly singleton-like style. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index d569188984f2990471f5a3e1833af4474798da6b..343c33f7ba08b0e018cea6a68cacd880ec22213e 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -448,8 +448,8 @@ void BrowserMainLoop::MainMessageLoopStart() {
{
TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:PowerMonitor")
scoped_ptr<base::PowerMonitorSource> power_monitor_source(
- new base::PowerMonitorDeviceSource());
- power_monitor_.reset(new base::PowerMonitor(power_monitor_source.Pass()));
+ new base::PowerMonitorDeviceSource());
+ base::PowerMonitor::Initialize(power_monitor_source.Pass());
}
{
TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:HighResTimerManager")
@@ -903,6 +903,11 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
}
#endif // !defined(OS_IOS)
+ {
+ TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PowerMonitor");
+ base::PowerMonitor::Shutdown();
+ }
+
if (parts_) {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads");
parts_->PostDestroyThreads();

Powered by Google App Engine
This is Rietveld 408576698