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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/client/gpu_channel_host.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index fc6e89dfda4755978ae9c1c46d797591f65ee73b..64c0c7a626a0335c655d4bac8cce0d0db0c37637 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -11,9 +11,11 @@
#include "base/message_loop.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/posix/eintr_wrapper.h"
+#include "base/power_monitor/power_monitor.h"
#include "base/threading/thread_restrictions.h"
#include "content/common/gpu/client/command_buffer_proxy_impl.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/power_monitor_service.h"
#include "googleurl/src/gurl.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "ipc/ipc_sync_message_filter.h"
@@ -52,8 +54,13 @@ GpuChannelHost::GpuChannelHost(GpuChannelHostFactory* factory,
: factory_(factory),
client_id_(client_id),
gpu_host_id_(gpu_host_id),
- gpu_info_(gpu_info) {
+ gpu_info_(gpu_info),
+ power_monitor_service_(new PowerMonitorService(this)) {
next_transfer_buffer_id_.GetNext();
+
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ if (power_monitor)
+ power_monitor->AddObserver(power_monitor_service_.get());
Ken Russell (switch to Gerrit) 2013/06/24 22:54:38 Unless I'm misremembering and misreading the code,
}
void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle) {

Powered by Google App Engine
This is Rietveld 408576698