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

Unified Diff: chrome/test/base/mojo_test_connector.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: Rebase Created 4 years, 6 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/browser/chromeos/arc/gpu_arc_video_service_host.cc ('k') | components/arc/arc_bridge_bootstrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2a792a31ec9c96034cc984006f366e7078829767..1aa9f3a67d32e9da1519c10843ef90024fd60c0e 100644
--- a/chrome/test/base/mojo_test_connector.cc
+++ b/chrome/test/base/mojo_test_connector.cc
@@ -77,11 +77,11 @@ std::unique_ptr<shell::TestCatalogStore> BuildTestCatalogStore() {
// mojo. This class is only used on the thread created by BackgroundShell.
class BackgroundTestState {
public:
- BackgroundTestState() {}
+ BackgroundTestState() : child_token_(mojo::edk::GenerateRandomToken()) {}
~BackgroundTestState() {}
// Prepares the command line and other setup for connecting the test to mojo.
- // Must be paired with a clal to ChildProcessLaunched().
+ // Must be paired with a call to ChildProcessLaunched().
void Connect(base::CommandLine* command_line,
shell::Shell* shell,
const std::string& instance,
@@ -103,7 +103,7 @@ class BackgroundTestState {
#error "Unsupported"
#endif
shell::mojom::ShellClientPtr client =
- shell::PassShellClientRequestOnCommandLine(command_line);
+ shell::PassShellClientRequestOnCommandLine(command_line, child_token_);
std::unique_ptr<shell::ConnectParams> params(new shell::ConnectParams);
params->set_source(shell::CreateShellIdentity());
@@ -127,11 +127,13 @@ class BackgroundTestState {
mojo_ipc_channel_->ChildProcessLaunched();
mojo::edk::ChildProcessLaunched(
handle, mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle(
- mojo_ipc_channel_->PassServerHandle().release().handle)));
+ mojo_ipc_channel_->PassServerHandle().release().handle)),
+ child_token_);
}
private:
// Used to back the NodeChannel between the parent and child node.
+ const std::string child_token_;
std::unique_ptr<mojo::edk::PlatformChannelPair> mojo_ipc_channel_;
mojo::edk::HandlePassingInformation handle_passing_info_;
« no previous file with comments | « chrome/browser/chromeos/arc/gpu_arc_video_service_host.cc ('k') | components/arc/arc_bridge_bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698