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

Unified Diff: content/child/child_thread_impl.cc

Issue 2460823002: Decouple Power Monitor from //content. (Closed)
Patch Set: Decouple Power Monitor from //content. Created 4 years, 2 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/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 8cd4f524326e5182e999e7e0ac34761c1e8a23ac..507e10a547421543f448759f72786363a8f7dab1 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -42,7 +42,6 @@
#include "content/child/fileapi/webfilesystem_impl.h"
#include "content/child/memory/child_memory_message_filter.h"
#include "content/child/notifications/notification_dispatcher.h"
-#include "content/child/power_monitor_broadcast_source.h"
#include "content/child/push_messaging/push_dispatcher.h"
#include "content/child/quota_dispatcher.h"
#include "content/child/quota_message_filter.h"
@@ -56,6 +55,7 @@
#include "content/public/common/mojo_channel_switches.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/service_names.h"
+#include "device/power_monitor/public/cpp/power_monitor_broadcast_source.h"
#include "ipc/ipc_channel_mojo.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_platform_file.h"
@@ -511,8 +511,13 @@ void ChildThreadImpl::Init(const Options& options) {
// In single process mode we may already have a power monitor
if (!base::PowerMonitor::Get()) {
- std::unique_ptr<PowerMonitorBroadcastSource> power_monitor_source(
- new PowerMonitorBroadcastSource());
+ device::mojom::PowerMonitorPtr power_monitor_message_broadcaster;
blundell 2016/11/07 12:50:08 See my comment on power_monitor_broadcast_source.h
ke.he 2016/11/08 08:59:55 Done.
+ GetRemoteInterfaces()->GetInterface(
+ mojo::GetProxy(&power_monitor_message_broadcaster));
+ std::unique_ptr<device::PowerMonitorBroadcastSource> power_monitor_source(
+ new device::PowerMonitorBroadcastSource(
+ power_monitor_message_broadcaster.get()));
+
power_monitor_.reset(
new base::PowerMonitor(std::move(power_monitor_source)));
}

Powered by Google App Engine
This is Rietveld 408576698