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

Unified Diff: chrome/test/base/mojo_test_connector.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
Index: chrome/test/base/mojo_test_connector.cc
diff --git a/chrome/test/base/mojo_test_connector.cc b/chrome/test/base/mojo_test_connector.cc
index 2c7e92ade6b207f95ca9d6f42c1c8347caae0312..fb6de366202797c068991ca20bee24b686a5d103 100644
--- a/chrome/test/base/mojo_test_connector.cc
+++ b/chrome/test/base/mojo_test_connector.cc
@@ -17,6 +17,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/test/test_launcher.h"
#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/pending_process_connection.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/scoped_ipc_support.h"
#include "mojo/public/cpp/bindings/interface_request.h"
@@ -68,8 +69,8 @@ class MojoTestState : public content::TestState {
#error "Unsupported"
#endif
service_manager::mojom::ServicePtr service =
- service_manager::PassServiceRequestOnCommandLine(command_line,
- child_token_);
+ service_manager::PassServiceRequestOnCommandLine(process_connection_,
+ command_line);
background_service_manager_->RegisterService(
service_manager::Identity(
@@ -87,8 +88,7 @@ class MojoTestState : public content::TestState {
void ChildProcessLaunched(base::ProcessHandle handle,
base::ProcessId pid) override {
platform_channel_->ChildProcessLaunched();
- mojo::edk::ChildProcessLaunched(
- handle, platform_channel_->PassServerHandle(), child_token_);
+ process_connection_.Connect(handle, platform_channel_->PassServerHandle());
main_task_runner_->PostTask(
FROM_HERE,
@@ -102,7 +102,7 @@ class MojoTestState : public content::TestState {
pid_receiver_.reset();
}
- const std::string child_token_;
+ mojo::edk::PendingProcessConnection process_connection_;
service_manager::BackgroundServiceManager* const background_service_manager_;
// NOTE: HandlePassingInformation must remain valid through process launch,

Powered by Google App Engine
This is Rietveld 408576698