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

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 2680973006: Mojo EDK: Add safe process connection API (Closed)
Patch Set: . Created 3 years, 10 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
« no previous file with comments | « chrome/service/service_utility_process_host.h ('k') | chrome/test/base/mojo_test_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_utility_process_host.cc
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 8932a87e508f16c94bdd5af6b71b4ce138b6bcb8..69b8a8d7f5c940a327738bc8521ba5e84b765225 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -169,7 +169,6 @@ ServiceUtilityProcessHost::ServiceUtilityProcessHost(
: client_(client),
client_task_runner_(client_task_runner),
waiting_for_reply_(false),
- mojo_child_token_(mojo::edk::GenerateRandomToken()),
weak_ptr_factory_(this) {
child_process_host_.reset(ChildProcessHost::Create(this));
}
@@ -221,7 +220,7 @@ bool ServiceUtilityProcessHost::StartGetPrinterSemanticCapsAndDefaults(
bool ServiceUtilityProcessHost::StartProcess(bool no_sandbox) {
std::string mojo_channel_token =
- child_process_host_->CreateChannelMojo(mojo_child_token_);
+ child_process_host_->CreateChannelMojo(&process_connection_);
if (mojo_channel_token.empty())
return false;
@@ -278,13 +277,9 @@ bool ServiceUtilityProcessHost::Launch(base::CommandLine* cmd_line,
}
}
- if (success) {
- mojo::edk::ChildProcessLaunched(process_.Handle(),
- std::move(parent_handle),
- mojo_child_token_);
- } else {
- mojo::edk::ChildProcessLaunchFailed(mojo_child_token_);
- }
+ if (success)
+ process_connection_.Connect(process_.Handle(), std::move(parent_handle));
+
return success;
}
« no previous file with comments | « chrome/service/service_utility_process_host.h ('k') | chrome/test/base/mojo_test_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698