OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host/in_process_native_runner.h" | 5 #include "services/shell/runner/host/in_process_native_runner.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.h" |
16 #include "mojo/public/cpp/bindings/interface_request.h" | 16 #include "mojo/public/cpp/bindings/interface_request.h" |
17 #include "mojo/shell/runner/host/native_application_support.h" | 17 #include "services/shell/runner/host/native_application_support.h" |
18 #include "mojo/shell/runner/host/out_of_process_native_runner.h" | 18 #include "services/shell/runner/host/out_of_process_native_runner.h" |
19 #include "mojo/shell/runner/init.h" | 19 #include "services/shell/runner/init.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 namespace shell { | 22 namespace shell { |
23 | 23 |
24 InProcessNativeRunner::InProcessNativeRunner() : app_library_(nullptr) {} | 24 InProcessNativeRunner::InProcessNativeRunner() : app_library_(nullptr) {} |
25 | 25 |
26 InProcessNativeRunner::~InProcessNativeRunner() { | 26 InProcessNativeRunner::~InProcessNativeRunner() { |
27 // It is important to let the thread exit before unloading the DSO (when | 27 // It is important to let the thread exit before unloading the DSO (when |
28 // app_library_ is destructed), because the library may have registered | 28 // app_library_ is destructed), because the library may have registered |
29 // thread-local data and destructors to run on thread termination. | 29 // thread-local data and destructors to run on thread termination. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Non-Mojo apps are always run in a new process. | 86 // Non-Mojo apps are always run in a new process. |
87 if (!app_path.MatchesExtension(FILE_PATH_LITERAL(".mojo"))) { | 87 if (!app_path.MatchesExtension(FILE_PATH_LITERAL(".mojo"))) { |
88 return make_scoped_ptr( | 88 return make_scoped_ptr( |
89 new OutOfProcessNativeRunner(launch_process_runner_, nullptr)); | 89 new OutOfProcessNativeRunner(launch_process_runner_, nullptr)); |
90 } | 90 } |
91 return make_scoped_ptr(new InProcessNativeRunner); | 91 return make_scoped_ptr(new InProcessNativeRunner); |
92 } | 92 } |
93 | 93 |
94 } // namespace shell | 94 } // namespace shell |
95 } // namespace mojo | 95 } // namespace mojo |
OLD | NEW |