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

Side by Side Diff: mojo/shell/runner/child/test_native_main.cc

Issue 1728083002: Extract a Connector interface from Shell that can be cloned & passed to other threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@12uid
Patch Set: . Created 4 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 unified diff | Download patch
« no previous file with comments | « mojo/shell/public/interfaces/shell.mojom ('k') | mojo/shell/standalone/context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/shell/runner/child/test_native_main.h" 5 #include "mojo/shell/runner/child/test_native_main.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 mojo::edk::Init(); 51 mojo::edk::Init();
52 52
53 ProcessDelegate process_delegate; 53 ProcessDelegate process_delegate;
54 base::Thread io_thread("io_thread"); 54 base::Thread io_thread("io_thread");
55 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); 55 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0);
56 CHECK(io_thread.StartWithOptions(io_thread_options)); 56 CHECK(io_thread.StartWithOptions(io_thread_options));
57 57
58 mojo::edk::InitIPCSupport(&process_delegate, io_thread.task_runner()); 58 mojo::edk::InitIPCSupport(&process_delegate, io_thread.task_runner());
59 59
60 mojo::ShellClientRequest request; 60 mojom::ShellClientRequest request;
61 scoped_ptr<mojo::shell::RunnerConnection> connection( 61 scoped_ptr<mojo::shell::RunnerConnection> connection(
62 mojo::shell::RunnerConnection::ConnectToRunner( 62 mojo::shell::RunnerConnection::ConnectToRunner(
63 &request, ScopedMessagePipeHandle())); 63 &request, ScopedMessagePipeHandle()));
64 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); 64 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create());
65 mojo::ShellConnection impl(shell_client, std::move(request)); 65 mojo::ShellConnection impl(shell_client, std::move(request));
66 loop.Run(); 66 loop.Run();
67 67
68 mojo::edk::ShutdownIPCSupport(); 68 mojo::edk::ShutdownIPCSupport();
69 } 69 }
70 70
71 return 0; 71 return 0;
72 } 72 }
73 73
74 } // namespace shell 74 } // namespace shell
75 } // namespace mojo 75 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/public/interfaces/shell.mojom ('k') | mojo/shell/standalone/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698