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

Side by Side Diff: content/test/render_thread_impl_browser_test_ipc_helper.cc

Issue 2096643002: Eliminate MojoApplicationHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mah3
Patch Set: . Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/test/render_thread_impl_browser_test_ipc_helper.h" 5 #include "content/test/render_thread_impl_browser_test_ipc_helper.h"
6 6
7 #include "ipc/ipc_channel_mojo.h"
7 #include "mojo/edk/embedder/embedder.h" 8 #include "mojo/edk/embedder/embedder.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 10
10 namespace content { 11 namespace content {
11 12
12 class RenderThreadImplBrowserIPCTestHelper::DummyListener 13 class RenderThreadImplBrowserIPCTestHelper::DummyListener
13 : public IPC::Listener { 14 : public IPC::Listener {
14 public: 15 public:
15 bool OnMessageReceived(const IPC::Message& message) override { return true; } 16 bool OnMessageReceived(const IPC::Message& message) override { return true; }
16 }; 17 };
(...skipping 17 matching lines...) Expand all
34 options.message_loop_type = base::MessageLoop::TYPE_IO; 35 options.message_loop_type = base::MessageLoop::TYPE_IO;
35 ASSERT_TRUE(ipc_thread_->StartWithOptions(options)); 36 ASSERT_TRUE(ipc_thread_->StartWithOptions(options));
36 } 37 }
37 38
38 void RenderThreadImplBrowserIPCTestHelper::SetupMojo() { 39 void RenderThreadImplBrowserIPCTestHelper::SetupMojo() {
39 InitializeMojo(); 40 InitializeMojo();
40 41
41 std::string child_token = mojo::edk::GenerateRandomToken(); 42 std::string child_token = mojo::edk::GenerateRandomToken();
42 ipc_support_.reset( 43 ipc_support_.reset(
43 new mojo::edk::test::ScopedIPCSupport(ipc_thread_->task_runner())); 44 new mojo::edk::test::ScopedIPCSupport(ipc_thread_->task_runner()));
44 mojo_application_host_.reset(new MojoApplicationHost(child_token)); 45 mojo_application_token_ = mojo::edk::GenerateRandomToken();
45 mojo_application_token_ = mojo_application_host_->GetToken();
46 46
47 mojo_ipc_token_ = mojo::edk::GenerateRandomToken(); 47 mojo_ipc_token_ = mojo::edk::GenerateRandomToken();
48 48
49 mojo::MessagePipe pipe; 49 mojo::MessagePipe pipe;
50 channel_ = IPC::ChannelProxy::Create( 50 channel_ = IPC::ChannelProxy::Create(
51 IPC::ChannelMojo::CreateServerFactory( 51 IPC::ChannelMojo::CreateServerFactory(
52 mojo::edk::CreateParentMessagePipe(mojo_ipc_token_, child_token)), 52 mojo::edk::CreateParentMessagePipe(mojo_ipc_token_, child_token)),
53 dummy_listener_.get(), ipc_thread_->task_runner()); 53 dummy_listener_.get(), ipc_thread_->task_runner());
54 } 54 }
55 55
56 scoped_refptr<base::SingleThreadTaskRunner> 56 scoped_refptr<base::SingleThreadTaskRunner>
57 RenderThreadImplBrowserIPCTestHelper::GetIOTaskRunner() const { 57 RenderThreadImplBrowserIPCTestHelper::GetIOTaskRunner() const {
58 return ipc_thread_->task_runner(); 58 return ipc_thread_->task_runner();
59 } 59 }
60 60
61 } // namespace content 61 } // namespace content
OLDNEW
« no previous file with comments | « content/test/render_thread_impl_browser_test_ipc_helper.h ('k') | content/utility/utility_process_control_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698