Index: content/gpu/gpu_main.cc |
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc |
index 22a8bf30711b79a6288e504c054d8ae522174137..db61560bba275af99f4da41d334c024bb287daa6 100644 |
--- a/content/gpu/gpu_main.cc |
+++ b/content/gpu/gpu_main.cc |
@@ -11,6 +11,7 @@ |
#include "base/debug/trace_event.h" |
#include "base/lazy_instance.h" |
#include "base/message_loop.h" |
+#include "base/power_monitor/power_monitor.h" |
#include "base/rand_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
@@ -20,6 +21,7 @@ |
#include "content/common/content_constants_internal.h" |
#include "content/common/gpu/gpu_config.h" |
#include "content/common/gpu/gpu_messages.h" |
+#include "content/common/power_monitor_broadcast_source.h" |
#include "content/common/sandbox_linux.h" |
#include "content/gpu/gpu_child_thread.h" |
#include "content/gpu/gpu_process.h" |
@@ -173,6 +175,13 @@ int GpuMain(const MainFunctionParams& parameters) { |
delayed_watchdog_enable = true; |
#endif |
+ scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( |
jam
2013/07/17 00:29:42
this should be connected in all processes (i.e. in
|
+ new PowerMonitorBroadcastSource(main_message_loop.message_loop_proxy())); |
+ IPC::ChannelProxy::MessageFilter* power_monitor_message_filter = |
+ power_monitor_source->MessageFilter(); |
+ scoped_ptr<base::PowerMonitor> power_monitor(new base::PowerMonitor( |
+ power_monitor_source.PassAs<base::PowerMonitorSource>())); |
+ |
scoped_refptr<GpuWatchdogThread> watchdog_thread; |
// Start the GPU watchdog only after anything that is expected to be time |
@@ -287,6 +296,9 @@ int GpuMain(const MainFunctionParams& parameters) { |
dead_on_arrival, |
gpu_info, |
deferred_messages.Get()); |
+ |
+ child_thread->channel()->AddFilter(power_monitor_message_filter); |
+ |
while (!deferred_messages.Get().empty()) |
deferred_messages.Get().pop(); |