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

Unified Diff: content/test/render_thread_impl_browser_test_ipc_helper.cc

Issue 1901513003: Re-land: "Use a token to initialise ChannelMojo and MojoApplication everywhere." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/test/render_thread_impl_browser_test_ipc_helper.h ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/render_thread_impl_browser_test_ipc_helper.cc
diff --git a/content/test/render_thread_impl_browser_test_ipc_helper.cc b/content/test/render_thread_impl_browser_test_ipc_helper.cc
index 241ec1ce9e4e70735a81ed98e0217f7a2be6a9e1..11f08516bb27efc80448f70512a4c7ec0d73cf0f 100644
--- a/content/test/render_thread_impl_browser_test_ipc_helper.cc
+++ b/content/test/render_thread_impl_browser_test_ipc_helper.cc
@@ -4,8 +4,8 @@
#include "content/test/render_thread_impl_browser_test_ipc_helper.h"
-#include "content/common/mojo/channel_init.h"
#include "content/public/common/mojo_channel_switches.h"
+#include "mojo/edk/embedder/embedder.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
@@ -48,18 +48,15 @@ void RenderThreadImplBrowserIPCTestHelper::SetupMojo() {
ipc_support_.reset(new IPC::ScopedIPCSupport(ipc_thread_->task_runner()));
mojo_application_host_.reset(new MojoApplicationHost());
- mojo_application_host_->OverrideIOTaskRunnerForTest(
- ipc_thread_->task_runner());
+ mojo_application_token_ = mojo_application_host_->GetToken();
+
+ mojo_ipc_token_ = mojo::edk::GenerateRandomToken();
mojo::MessagePipe pipe;
channel_ = IPC::ChannelProxy::Create(
- IPC::ChannelMojo::CreateServerFactory(std::move(pipe.handle0)),
+ IPC::ChannelMojo::CreateServerFactory(
+ mojo::edk::CreateParentMessagePipe(mojo_ipc_token_)),
dummy_listener_.get(), ipc_thread_->task_runner());
- message_pipe_handle_ = std::move(pipe.handle1);
-
- mojo_application_host_->Init();
- mojo_application_host_->Activate(channel_.get(),
- base::GetCurrentProcessHandle());
}
scoped_refptr<base::SingleThreadTaskRunner>
« no previous file with comments | « content/test/render_thread_impl_browser_test_ipc_helper.h ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698