OLD | NEW |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 ProcessDelegate process_delegate; | 54 ProcessDelegate process_delegate; |
55 base::Thread io_thread("io_thread"); | 55 base::Thread io_thread("io_thread"); |
56 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); | 56 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); |
57 CHECK(io_thread.StartWithOptions(io_thread_options)); | 57 CHECK(io_thread.StartWithOptions(io_thread_options)); |
58 | 58 |
59 mojo::embedder::InitIPCSupport( | 59 mojo::embedder::InitIPCSupport( |
60 mojo::embedder::ProcessType::NONE, &process_delegate, | 60 mojo::embedder::ProcessType::NONE, &process_delegate, |
61 io_thread.task_runner().get(), mojo::embedder::ScopedPlatformHandle()); | 61 io_thread.task_runner().get(), mojo::embedder::ScopedPlatformHandle()); |
62 | 62 |
63 mojo::InterfaceRequest<mojo::Application> application_request; | 63 mojo::ApplicationRequest application_request; |
64 scoped_ptr<mojo::shell::RunnerConnection> connection( | 64 scoped_ptr<mojo::shell::RunnerConnection> connection( |
65 mojo::shell::RunnerConnection::ConnectToRunner( | 65 mojo::shell::RunnerConnection::ConnectToRunner( |
66 &application_request, ScopedMessagePipeHandle())); | 66 &application_request, ScopedMessagePipeHandle())); |
67 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); | 67 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); |
68 mojo::ApplicationImpl impl(application_delegate, | 68 mojo::ApplicationImpl impl(application_delegate, |
69 std::move(application_request)); | 69 std::move(application_request)); |
70 loop.Run(); | 70 loop.Run(); |
71 | 71 |
72 mojo::embedder::ShutdownIPCSupport(); | 72 mojo::embedder::ShutdownIPCSupport(); |
73 } | 73 } |
74 | 74 |
75 return 0; | 75 return 0; |
76 } | 76 } |
77 | 77 |
78 } // namespace shell | 78 } // namespace shell |
79 } // namespace mojo | 79 } // namespace mojo |
OLD | NEW |