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

Unified Diff: content/browser/browser_child_process_host_impl.cc

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arc fix Created 4 years, 7 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 061240a62a9ef9cd8dafda0fa563b1b05cf7be10..e16b06bb3c7bc3cc74f360752e82bc1834b2a784 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -82,7 +82,16 @@ void NotifyProcessKilled(const ChildProcessData& data, int exit_code) {
BrowserChildProcessHost* BrowserChildProcessHost::Create(
content::ProcessType process_type,
BrowserChildProcessHostDelegate* delegate) {
- return new BrowserChildProcessHostImpl(process_type, delegate);
+ return new BrowserChildProcessHostImpl(
+ process_type, delegate, mojo::edk::GenerateRandomToken());
+}
+
+BrowserChildProcessHost* BrowserChildProcessHost::Create(
+ content::ProcessType process_type,
+ BrowserChildProcessHostDelegate* delegate,
+ const std::string& mojo_child_token) {
+ return new BrowserChildProcessHostImpl(
+ process_type, delegate, mojo_child_token);
}
BrowserChildProcessHost* BrowserChildProcessHost::FromID(int child_process_id) {
@@ -124,9 +133,11 @@ void BrowserChildProcessHostImpl::RemoveObserver(
BrowserChildProcessHostImpl::BrowserChildProcessHostImpl(
content::ProcessType process_type,
- BrowserChildProcessHostDelegate* delegate)
+ BrowserChildProcessHostDelegate* delegate,
+ const std::string& mojo_child_token)
: data_(process_type),
delegate_(delegate),
+ mojo_child_token_(mojo_child_token),
power_monitor_message_broadcaster_(this),
is_channel_connected_(false),
notify_child_disconnected_(false) {
@@ -229,6 +240,7 @@ void BrowserChildProcessHostImpl::Launch(
cmd_line,
data_.id,
this,
+ mojo_child_token_,
terminate_on_shutdown));
}

Powered by Google App Engine
This is Rietveld 408576698