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 SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 5 #ifndef SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
6 #define SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 6 #define SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "services/shell/native_runner.h" | 16 #include "services/shell/native_runner.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class TaskRunner; | 19 class TaskRunner; |
20 } | 20 } |
21 | 21 |
22 namespace mojo { | |
23 namespace shell { | 22 namespace shell { |
24 | 23 |
25 class ChildProcessHost; | 24 class ChildProcessHost; |
26 class NativeRunnerDelegate; | 25 class NativeRunnerDelegate; |
27 | 26 |
28 // An implementation of |NativeRunner| that loads/runs the given app (from the | 27 // An implementation of |NativeRunner| that loads/runs the given app (from the |
29 // file system) in a separate process (of its own). | 28 // file system) in a separate process (of its own). |
30 class OutOfProcessNativeRunner : public NativeRunner { | 29 class OutOfProcessNativeRunner : public NativeRunner { |
31 public: | 30 public: |
32 OutOfProcessNativeRunner(base::TaskRunner* launch_process_runner, | 31 OutOfProcessNativeRunner(base::TaskRunner* launch_process_runner, |
(...skipping 10 matching lines...) Expand all Loading... |
43 | 42 |
44 private: | 43 private: |
45 void AppCompleted(); | 44 void AppCompleted(); |
46 | 45 |
47 base::TaskRunner* const launch_process_runner_; | 46 base::TaskRunner* const launch_process_runner_; |
48 NativeRunnerDelegate* delegate_; | 47 NativeRunnerDelegate* delegate_; |
49 | 48 |
50 base::FilePath app_path_; | 49 base::FilePath app_path_; |
51 base::Closure app_completed_callback_; | 50 base::Closure app_completed_callback_; |
52 | 51 |
53 scoped_ptr<ChildProcessHost> child_process_host_; | 52 std::unique_ptr<ChildProcessHost> child_process_host_; |
54 | 53 |
55 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunner); | 54 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunner); |
56 }; | 55 }; |
57 | 56 |
58 class OutOfProcessNativeRunnerFactory : public NativeRunnerFactory { | 57 class OutOfProcessNativeRunnerFactory : public NativeRunnerFactory { |
59 public: | 58 public: |
60 OutOfProcessNativeRunnerFactory(base::TaskRunner* launch_process_runner, | 59 OutOfProcessNativeRunnerFactory(base::TaskRunner* launch_process_runner, |
61 NativeRunnerDelegate* delegate); | 60 NativeRunnerDelegate* delegate); |
62 ~OutOfProcessNativeRunnerFactory() override; | 61 ~OutOfProcessNativeRunnerFactory() override; |
63 | 62 |
64 scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) override; | 63 std::unique_ptr<NativeRunner> Create(const base::FilePath& app_path) override; |
65 | 64 |
66 private: | 65 private: |
67 base::TaskRunner* const launch_process_runner_; | 66 base::TaskRunner* const launch_process_runner_; |
68 NativeRunnerDelegate* delegate_; | 67 NativeRunnerDelegate* delegate_; |
69 | 68 |
70 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunnerFactory); | 69 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunnerFactory); |
71 }; | 70 }; |
72 | 71 |
73 } // namespace shell | 72 } // namespace shell |
74 } // namespace mojo | |
75 | 73 |
76 #endif // SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 74 #endif // SERVICES_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
OLD | NEW |