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

Unified Diff: content/browser/browser_child_process_host_impl.cc

Issue 2433203003: Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process (Closed)
Patch Set: Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process 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/browser/browser_child_process_host_impl.cc
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 60adf7b60e194a214fa6403d048f81eed99586b1..c523c4868ada0722907e7e7b140995bfdd190cbd 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -43,6 +43,7 @@
#include "content/public/common/mojo_channel_switches.h"
#include "content/public/common/process_type.h"
#include "content/public/common/result_codes.h"
+#include "device/power_monitor/public/interfaces/power_monitor.mojom.h"
#include "ipc/attachment_broker.h"
#include "ipc/attachment_broker_privileged.h"
#include "mojo/edk/embedder/embedder.h"
@@ -144,7 +145,6 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
: data_(process_type),
delegate_(delegate),
child_token_(mojo::edk::GenerateRandomToken()),
- power_monitor_message_broadcaster_(this),
is_channel_connected_(false),
notify_child_disconnected_(false),
weak_factory_(this) {
@@ -172,8 +172,6 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
g_child_process_list.Get().push_back(this);
GetContentClient()->browser()->BrowserChildProcessHostCreated(this);
- power_monitor_message_broadcaster_.Init();
-
if (!service_name.empty()) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
child_connection_.reset(new ChildConnection(
@@ -182,6 +180,10 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
base::ThreadTaskRunnerHandle::Get()));
}
+ device::mojom::PowerMonitorClientPtr power_monitor_client;
+ GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&power_monitor_client));
+ power_monitor_message_broadcaster_.Init(power_monitor_client);
+
// Create a persistent memory segment for subprocess histograms.
CreateMetricsAllocator();
}

Powered by Google App Engine
This is Rietveld 408576698