| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| 11 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 21 #include "mojo/edk/embedder/embedder.h" | 21 #include "mojo/edk/embedder/embedder.h" |
| 22 #include "mojo/edk/embedder/platform_channel_pair.h" | 22 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 23 #include "mojo/edk/embedder/scoped_platform_handle.h" | 23 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 24 #include "mojo/public/cpp/bindings/weak_binding_set.h" | 24 #include "mojo/public/cpp/bindings/binding_set.h" |
| 25 #include "mojo/shell/public/cpp/connection.h" | 25 #include "mojo/shell/public/cpp/connection.h" |
| 26 #include "mojo/shell/public/cpp/interface_factory.h" | 26 #include "mojo/shell/public/cpp/interface_factory.h" |
| 27 #include "mojo/shell/public/cpp/shell.h" | 27 #include "mojo/shell/public/cpp/shell.h" |
| 28 #include "mojo/shell/public/cpp/shell_client.h" | 28 #include "mojo/shell/public/cpp/shell_client.h" |
| 29 #include "mojo/shell/public/interfaces/application_manager.mojom.h" | 29 #include "mojo/shell/public/interfaces/application_manager.mojom.h" |
| 30 #include "mojo/shell/runner/child/test_native_main.h" | 30 #include "mojo/shell/runner/child/test_native_main.h" |
| 31 #include "mojo/shell/runner/common/switches.h" | 31 #include "mojo/shell/runner/common/switches.h" |
| 32 #include "mojo/shell/runner/init.h" | 32 #include "mojo/shell/runner/init.h" |
| 33 #include "mojo/shell/tests/application_manager_apptests.mojom.h" | 33 #include "mojo/shell/tests/application_manager_apptests.mojom.h" |
| 34 | 34 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Driver: | 131 // Driver: |
| 132 void QuitDriver() override { | 132 void QuitDriver() override { |
| 133 target_.Terminate(0, false); | 133 target_.Terminate(0, false); |
| 134 shell_->Quit(); | 134 shell_->Quit(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 mojo::Shell* shell_; | 137 mojo::Shell* shell_; |
| 138 base::Process target_; | 138 base::Process target_; |
| 139 mojo::WeakBindingSet<Driver> bindings_; | 139 mojo::BindingSet<Driver> bindings_; |
| 140 base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_; | 140 base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_; |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); | 142 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace | 145 } // namespace |
| 146 | 146 |
| 147 int main(int argc, char** argv) { | 147 int main(int argc, char** argv) { |
| 148 base::AtExitManager at_exit; | 148 base::AtExitManager at_exit; |
| 149 base::CommandLine::Init(argc, argv); | 149 base::CommandLine::Init(argc, argv); |
| 150 | 150 |
| 151 mojo::shell::InitializeLogging(); | 151 mojo::shell::InitializeLogging(); |
| 152 | 152 |
| 153 TargetApplicationDelegate delegate; | 153 TargetApplicationDelegate delegate; |
| 154 return mojo::shell::TestNativeMain(&delegate); | 154 return mojo::shell::TestNativeMain(&delegate); |
| 155 } | 155 } |
| OLD | NEW |