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 MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_RUNNER_H_ | 5 #ifndef MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_RUNNER_H_ |
6 #define MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_RUNNER_H_ | 6 #define MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class InProcessNativeRunner : public NativeRunner, | 26 class InProcessNativeRunner : public NativeRunner, |
27 public base::DelegateSimpleThread::Delegate { | 27 public base::DelegateSimpleThread::Delegate { |
28 public: | 28 public: |
29 InProcessNativeRunner(); | 29 InProcessNativeRunner(); |
30 ~InProcessNativeRunner() override; | 30 ~InProcessNativeRunner() override; |
31 | 31 |
32 // NativeRunner: | 32 // NativeRunner: |
33 void Start( | 33 void Start( |
34 const base::FilePath& app_path, | 34 const base::FilePath& app_path, |
35 bool start_sandboxed, | 35 bool start_sandboxed, |
36 InterfaceRequest<mojom::Application> application_request, | 36 InterfaceRequest<mojom::ShellClient> request, |
37 const base::Callback<void(base::ProcessId)>& pid_available_callback, | 37 const base::Callback<void(base::ProcessId)>& pid_available_callback, |
38 const base::Closure& app_completed_callback) override; | 38 const base::Closure& app_completed_callback) override; |
39 void InitHost( | 39 void InitHost( |
40 ScopedHandle channel, | 40 ScopedHandle channel, |
41 InterfaceRequest<mojom::Application> application_request) override; | 41 InterfaceRequest<mojom::ShellClient> request) override; |
42 | 42 |
43 private: | 43 private: |
44 // |base::DelegateSimpleThread::Delegate| method: | 44 // |base::DelegateSimpleThread::Delegate| method: |
45 void Run() override; | 45 void Run() override; |
46 | 46 |
47 base::FilePath app_path_; | 47 base::FilePath app_path_; |
48 InterfaceRequest<mojom::Application> application_request_; | 48 InterfaceRequest<mojom::ShellClient> request_; |
49 base::Callback<bool(void)> app_completed_callback_runner_; | 49 base::Callback<bool(void)> app_completed_callback_runner_; |
50 | 50 |
51 base::ScopedNativeLibrary app_library_; | 51 base::ScopedNativeLibrary app_library_; |
52 scoped_ptr<base::DelegateSimpleThread> thread_; | 52 scoped_ptr<base::DelegateSimpleThread> thread_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunner); | 54 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunner); |
55 }; | 55 }; |
56 | 56 |
57 class InProcessNativeRunnerFactory : public NativeRunnerFactory { | 57 class InProcessNativeRunnerFactory : public NativeRunnerFactory { |
58 public: | 58 public: |
59 explicit InProcessNativeRunnerFactory(base::TaskRunner* launch_process_runner) | 59 explicit InProcessNativeRunnerFactory(base::TaskRunner* launch_process_runner) |
60 : launch_process_runner_(launch_process_runner) {} | 60 : launch_process_runner_(launch_process_runner) {} |
61 ~InProcessNativeRunnerFactory() override {} | 61 ~InProcessNativeRunnerFactory() override {} |
62 | 62 |
63 scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) override; | 63 scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) override; |
64 | 64 |
65 private: | 65 private: |
66 base::TaskRunner* const launch_process_runner_; | 66 base::TaskRunner* const launch_process_runner_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunnerFactory); | 68 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunnerFactory); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace shell | 71 } // namespace shell |
72 } // namespace mojo | 72 } // namespace mojo |
73 | 73 |
74 #endif // MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_RUNNER_H_ | 74 #endif // MOJO_SHELL_RUNNER_HOST_IN_PROCESS_NATIVE_RUNNER_H_ |
OLD | NEW |