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 #ifndef SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ | 5 #ifndef SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ |
6 #define SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ | 6 #define SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "shell/app_child_process.mojom.h" | 11 #include "shell/app_child_process.mojom.h" |
12 #include "shell/app_child_process_host.h" | 12 #include "shell/app_child_process_host.h" |
13 #include "shell/dynamic_service_runner.h" | 13 #include "shell/dynamic_service_runner.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 namespace shell { | 16 namespace shell { |
17 | 17 |
18 // An implementation of |DynamicServiceRunner| that loads/runs the given app | 18 // An implementation of |DynamicServiceRunner| that loads/runs the given app |
19 // (from the file system) in a separate process (of its own). | 19 // (from the file system) in a separate process (of its own). |
20 class OutOfProcessDynamicServiceRunner : public DynamicServiceRunner, | 20 class OutOfProcessDynamicServiceRunner : public DynamicServiceRunner, |
21 public AppChildControllerClient { | 21 public AppChildControllerClient { |
22 public: | 22 public: |
23 explicit OutOfProcessDynamicServiceRunner(Context* context); | 23 explicit OutOfProcessDynamicServiceRunner(Context* context); |
24 ~OutOfProcessDynamicServiceRunner() override; | 24 ~OutOfProcessDynamicServiceRunner() override; |
25 | 25 |
26 // |DynamicServiceRunner| method: | 26 // |DynamicServiceRunner| method: |
27 void Start(const base::FilePath& app_path, | 27 void Start(const base::FilePath& app_path, |
| 28 bool clean_app_path, |
28 ScopedMessagePipeHandle service_handle, | 29 ScopedMessagePipeHandle service_handle, |
29 const base::Closure& app_completed_callback) override; | 30 const base::Closure& app_completed_callback) override; |
30 | 31 |
31 private: | 32 private: |
32 // |AppChildControllerClient| method: | 33 // |AppChildControllerClient| method: |
33 void AppCompleted(int32_t result) override; | 34 void AppCompleted(int32_t result) override; |
34 | 35 |
35 Context* const context_; | 36 Context* const context_; |
36 | 37 |
37 base::FilePath app_path_; | 38 base::FilePath app_path_; |
38 base::Closure app_completed_callback_; | 39 base::Closure app_completed_callback_; |
39 | 40 |
40 scoped_ptr<AppChildProcessHost> app_child_process_host_; | 41 scoped_ptr<AppChildProcessHost> app_child_process_host_; |
41 | 42 |
42 DISALLOW_COPY_AND_ASSIGN(OutOfProcessDynamicServiceRunner); | 43 DISALLOW_COPY_AND_ASSIGN(OutOfProcessDynamicServiceRunner); |
43 }; | 44 }; |
44 | 45 |
45 typedef DynamicServiceRunnerFactoryImpl<OutOfProcessDynamicServiceRunner> | 46 typedef DynamicServiceRunnerFactoryImpl<OutOfProcessDynamicServiceRunner> |
46 OutOfProcessDynamicServiceRunnerFactory; | 47 OutOfProcessDynamicServiceRunnerFactory; |
47 | 48 |
48 } // namespace shell | 49 } // namespace shell |
49 } // namespace mojo | 50 } // namespace mojo |
50 | 51 |
51 #endif // SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ | 52 #endif // SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_ |
OLD | NEW |