Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: services/shell/runner/host/in_process_native_runner.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "services/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/memory/ptr_util.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "base/task_runner.h" 14 #include "base/task_runner.h"
14 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
15 #include "base/threading/platform_thread.h" 16 #include "base/threading/platform_thread.h"
16 #include "mojo/public/cpp/bindings/interface_request.h" 17 #include "mojo/public/cpp/bindings/interface_request.h"
17 #include "services/shell/runner/host/native_application_support.h" 18 #include "services/shell/runner/host/native_application_support.h"
18 #include "services/shell/runner/host/out_of_process_native_runner.h" 19 #include "services/shell/runner/host/out_of_process_native_runner.h"
19 #include "services/shell/runner/init.h" 20 #include "services/shell/runner/init.h"
20 21
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.
30 if (thread_) { 30 if (thread_) {
31 DCHECK(thread_->HasBeenStarted()); 31 DCHECK(thread_->HasBeenStarted());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // This hangs on Windows in the component build, so skip it since it's 74 // This hangs on Windows in the component build, so skip it since it's
75 // unnecessary. 75 // unnecessary.
76 #if !(defined(COMPONENT_BUILD) && defined(OS_WIN)) 76 #if !(defined(COMPONENT_BUILD) && defined(OS_WIN))
77 CallLibraryEarlyInitialization(app_library); 77 CallLibraryEarlyInitialization(app_library);
78 #endif 78 #endif
79 RunNativeApplication(app_library, std::move(request_)); 79 RunNativeApplication(app_library, std::move(request_));
80 app_completed_callback_runner_.Run(); 80 app_completed_callback_runner_.Run();
81 app_completed_callback_runner_.Reset(); 81 app_completed_callback_runner_.Reset();
82 } 82 }
83 83
84 scoped_ptr<NativeRunner> InProcessNativeRunnerFactory::Create( 84 std::unique_ptr<NativeRunner> InProcessNativeRunnerFactory::Create(
85 const base::FilePath& app_path) { 85 const base::FilePath& app_path) {
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 base::WrapUnique(
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 base::WrapUnique(new InProcessNativeRunner);
92 } 92 }
93 93
94 } // namespace shell 94 } // namespace shell
95 } // namespace mojo
OLDNEW
« no previous file with comments | « services/shell/runner/host/in_process_native_runner.h ('k') | services/shell/runner/host/in_process_native_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698