| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NATIVE_RUNNER_H_ | 5 #ifndef MOJO_SHELL_NATIVE_RUNNER_H_ |
| 6 #define MOJO_SHELL_NATIVE_RUNNER_H_ | 6 #define MOJO_SHELL_NATIVE_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 #include "mojo/shell/public/interfaces/shell_client.mojom.h" | 12 #include "mojo/shell/public/interfaces/shell_client.mojom.h" |
| 13 #include "mojo/shell/public/interfaces/shell_client_factory.mojom.h" | |
| 14 | 13 |
| 15 namespace base { | 14 namespace base { |
| 16 class FilePath; | 15 class FilePath; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace mojo { | 18 namespace mojo { |
| 20 class Identity; | 19 class Identity; |
| 21 namespace shell { | 20 namespace shell { |
| 22 | 21 |
| 23 | 22 |
| 24 // Shell requires implementations of NativeRunner and NativeRunnerFactory to run | 23 // Shell requires implementations of NativeRunner and NativeRunnerFactory to run |
| 25 // native applications. | 24 // native applications. |
| 26 class NativeRunner { | 25 class NativeRunner { |
| 27 public: | 26 public: |
| 28 virtual ~NativeRunner() {} | 27 virtual ~NativeRunner() {} |
| 29 | 28 |
| 30 // Loads the app in the file at |app_path| and runs it on some other | 29 // Loads the app in the file at |app_path| and runs it on some other |
| 31 // thread/process. | 30 // thread/process. Returns a ShellClient handle the shell can use to connect |
| 32 virtual void Start( | 31 // to the the app. |
| 32 virtual mojom::ShellClientPtr Start( |
| 33 const base::FilePath& app_path, | 33 const base::FilePath& app_path, |
| 34 const Identity& target, | 34 const Identity& target, |
| 35 bool start_sandboxed, | 35 bool start_sandboxed, |
| 36 InterfaceRequest<mojom::ShellClient> request, | |
| 37 const base::Callback<void(base::ProcessId)>& pid_available_callback, | 36 const base::Callback<void(base::ProcessId)>& pid_available_callback, |
| 38 const base::Closure& app_completed_callback) = 0; | 37 const base::Closure& app_completed_callback) = 0; |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 class NativeRunnerFactory { | 40 class NativeRunnerFactory { |
| 42 public: | 41 public: |
| 43 virtual ~NativeRunnerFactory() {} | 42 virtual ~NativeRunnerFactory() {} |
| 44 virtual scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) = 0; | 43 virtual scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) = 0; |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 } // namespace shell | 46 } // namespace shell |
| 48 } // namespace mojo | 47 } // namespace mojo |
| 49 | 48 |
| 50 #endif // MOJO_SHELL_NATIVE_RUNNER_H_ | 49 #endif // MOJO_SHELL_NATIVE_RUNNER_H_ |
| OLD | NEW |