| 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 <windows.h> | |
| 6 | |
| 7 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 9 #include "base/debug/stack_trace.h" | 7 #include "base/debug/stack_trace.h" |
| 10 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 12 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
| 13 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
| 14 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 15 #include "mojo/application/public/cpp/application_connection.h" | 13 #include "mojo/application/public/cpp/application_connection.h" |
| 16 #include "mojo/application/public/cpp/application_delegate.h" | 14 #include "mojo/application/public/cpp/application_delegate.h" |
| 17 #include "mojo/application/public/cpp/application_impl.h" | 15 #include "mojo/application/public/cpp/application_impl.h" |
| 18 #include "mojo/application/public/cpp/interface_factory.h" | 16 #include "mojo/application/public/cpp/interface_factory.h" |
| 19 #include "mojo/application/public/interfaces/application.mojom.h" | 17 #include "mojo/application/public/interfaces/application.mojom.h" |
| 20 #include "mojo/common/weak_binding_set.h" | 18 #include "mojo/common/weak_binding_set.h" |
| 21 #include "mojo/message_pump/message_pump_mojo.h" | 19 #include "mojo/message_pump/message_pump_mojo.h" |
| 22 #include "mojo/runner/child/runner_connection.h" | 20 #include "mojo/runner/child/runner_connection.h" |
| 23 #include "mojo/runner/child/test_native_service.mojom.h" | 21 #include "mojo/runner/child/test_native_service.mojom.h" |
| 24 #include "mojo/runner/init.h" | 22 #include "mojo/runner/init.h" |
| 25 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 23 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| 26 #include "third_party/mojo/src/mojo/edk/embedder/process_delegate.h" | 24 #include "third_party/mojo/src/mojo/edk/embedder/process_delegate.h" |
| 27 | 25 |
| 26 #if defined(OS_WIN) |
| 27 #include <windows.h> |
| 28 #endif |
| 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 class EDKState : public mojo::embedder::ProcessDelegate { | 32 class EDKState : public mojo::embedder::ProcessDelegate { |
| 31 public: | 33 public: |
| 32 EDKState() : io_thread_("io_thread") { | 34 EDKState() : io_thread_("io_thread") { |
| 33 mojo::embedder::Init(); | 35 mojo::embedder::Init(); |
| 34 | 36 |
| 35 // Create and start our I/O thread. | 37 // Create and start our I/O thread. |
| 36 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); | 38 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); |
| 37 CHECK(io_thread_.StartWithOptions(io_thread_options)); | 39 CHECK(io_thread_.StartWithOptions(io_thread_options)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); | 119 base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); |
| 118 mojo::ApplicationImpl impl(&delegate, application_request.Pass()); | 120 mojo::ApplicationImpl impl(&delegate, application_request.Pass()); |
| 119 loop.Run(); | 121 loop.Run(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 connection.reset(); | 124 connection.reset(); |
| 123 } | 125 } |
| 124 | 126 |
| 125 return 0; | 127 return 0; |
| 126 } | 128 } |
| OLD | NEW |