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

Unified Diff: content/child/child_thread.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows unit test errors Created 7 years, 5 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 | « content/child/child_thread.h ('k') | content/child/power_monitor_broadcast_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread.cc
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index d41c5aeeddf12c9a851d9daee69ef54a1c0d53bd..37843d1b47b907daa9f1dd3a3de252076dbdfd76 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -19,6 +19,7 @@
#include "content/child/child_process.h"
#include "content/child/child_resource_message_filter.h"
#include "content/child/fileapi/file_system_dispatcher.h"
+#include "content/child/power_monitor_broadcast_source.h"
#include "content/child/quota_dispatcher.h"
#include "content/child/quota_message_filter.h"
#include "content/child/resource_dispatcher.h"
@@ -155,6 +156,16 @@ void ChildThread::Init() {
channel_->AddFilter(resource_message_filter_.get());
channel_->AddFilter(quota_message_filter_.get());
+ // In single process mode we may already have a power monitor
+ if (!base::PowerMonitor::Get()) {
+ scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source(
+ new PowerMonitorBroadcastSource());
+ channel_->AddFilter(power_monitor_source->GetMessageFilter());
+
+ power_monitor_.reset(new base::PowerMonitor(
+ power_monitor_source.PassAs<base::PowerMonitorSource>()));
+ }
+
#if defined(OS_POSIX)
// Check that --process-type is specified so we don't do this in unit tests
// and single-process mode.
« no previous file with comments | « content/child/child_thread.h ('k') | content/child/power_monitor_broadcast_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698