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/out_of_process_native_runner.h" | 5 #include "mojo/shell/out_of_process_native_runner.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 void OutOfProcessNativeRunner::Start( | 31 void OutOfProcessNativeRunner::Start( |
32 const base::FilePath& app_path, | 32 const base::FilePath& app_path, |
33 NativeApplicationCleanup cleanup, | 33 NativeApplicationCleanup cleanup, |
34 InterfaceRequest<Application> application_request, | 34 InterfaceRequest<Application> application_request, |
35 const base::Closure& app_completed_callback) { | 35 const base::Closure& app_completed_callback) { |
36 app_path_ = app_path; | 36 app_path_ = app_path; |
37 | 37 |
38 DCHECK(app_completed_callback_.is_null()); | 38 DCHECK(app_completed_callback_.is_null()); |
39 app_completed_callback_ = app_completed_callback; | 39 app_completed_callback_ = app_completed_callback; |
40 | 40 |
41 child_process_host_.reset(new ChildProcessHost(context_)); | 41 std::string name = app_path.BaseName().RemoveExtension().MaybeAsASCII(); |
| 42 child_process_host_.reset(new ChildProcessHost(context_, name)); |
42 child_process_host_->Start(); | 43 child_process_host_->Start(); |
43 | 44 |
44 // TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe. | 45 // TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe. |
45 child_process_host_->StartApp( | 46 child_process_host_->StartApp( |
46 app_path.AsUTF8Unsafe(), cleanup == NativeApplicationCleanup::DELETE, | 47 app_path.AsUTF8Unsafe(), cleanup == NativeApplicationCleanup::DELETE, |
47 application_request.Pass(), | 48 application_request.Pass(), |
48 base::Bind(&OutOfProcessNativeRunner::AppCompleted, | 49 base::Bind(&OutOfProcessNativeRunner::AppCompleted, |
49 base::Unretained(this))); | 50 base::Unretained(this))); |
50 } | 51 } |
51 | 52 |
(...skipping 10 matching lines...) Expand all Loading... |
62 scoped_ptr<NativeRunner> OutOfProcessNativeRunnerFactory::Create( | 63 scoped_ptr<NativeRunner> OutOfProcessNativeRunnerFactory::Create( |
63 const Options& options) { | 64 const Options& options) { |
64 if (options.force_in_process) | 65 if (options.force_in_process) |
65 return make_scoped_ptr(new InProcessNativeRunner(context_)); | 66 return make_scoped_ptr(new InProcessNativeRunner(context_)); |
66 | 67 |
67 return make_scoped_ptr(new OutOfProcessNativeRunner(context_)); | 68 return make_scoped_ptr(new OutOfProcessNativeRunner(context_)); |
68 } | 69 } |
69 | 70 |
70 } // namespace shell | 71 } // namespace shell |
71 } // namespace mojo | 72 } // namespace mojo |
OLD | NEW |