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..f1bcee2f4a9c616b6641652ce07a2369c8eeaf58 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" |
@@ -42,8 +43,7 @@ class MojoTestState : public content::TestState { |
public: |
explicit MojoTestState( |
service_manager::BackgroundServiceManager* background_service_manager) |
- : child_token_(mojo::edk::GenerateRandomToken()), |
- background_service_manager_(background_service_manager), |
+ : background_service_manager_(background_service_manager), |
weak_factory_(this) {} |
~MojoTestState() override {} |
@@ -68,8 +68,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 +87,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 +101,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, |