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

Unified Diff: content/common/gpu/gpu_channel.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Uber-refactor Created 7 years, 6 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/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 0c5172cf45cf0a9c5586381dc8f7687b3ee10c03..32244e23b65c8ccecb602edd3e05a886ef754d18 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -15,6 +15,7 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/power_monitor/power_monitor.h"
#include "base/process_util.h"
#include "base/rand_util.h"
#include "base/strings/string_util.h"
@@ -22,6 +23,7 @@
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/sync_point_manager.h"
+#include "content/common/power_monitor_message_filter.h"
#include "content/public/common/content_switches.h"
#include "crypto/hmac.h"
#include "gpu/command_buffer/common/mailbox.h"
@@ -487,6 +489,11 @@ bool GpuChannel::Init(base::MessageLoopProxy* io_message_loop,
io_message_loop_ = io_message_loop;
channel_->AddFilter(filter_.get());
+ PowerMonitorBroadcastSource* power_monitor_source_ =
+ static_cast<PowerMonitorBroadcastSource*>(
vandebo (ex-Chrome) 2013/06/26 21:40:33 Is it easy to get at the original source instead o
+ base::PowerMonitor::Get()->Source());
+ channel_->AddFilter(power_monitor_source_->MessageFilter());
vandebo (ex-Chrome) 2013/06/26 21:40:33 Is there ever a RemoveFilter call? The concern is
Ken Russell (switch to Gerrit) 2013/06/27 13:08:23 This setup doesn't look correct to me. You want to
bajones 2013/07/01 20:21:58 I don't see any examples of a filter being removed
bajones 2013/07/01 20:21:58 I've moved the addition of the message filter into
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698