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