OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_SERVICE_MANAGER_NATIVE_RUNNER_H_ | |
6 #define SERVICES_SERVICE_MANAGER_NATIVE_RUNNER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/callback_forward.h" | |
11 #include "base/process/process_handle.h" | |
12 #include "mojo/public/cpp/bindings/interface_request.h" | |
13 #include "services/service_manager/public/interfaces/service.mojom.h" | |
14 | |
15 namespace base { | |
16 class FilePath; | |
17 } | |
18 | |
19 namespace service_manager { | |
20 class Identity; | |
21 | |
22 // Service Manager requires implementations of NativeRunner and | |
23 // NativeRunnerFactory to run native applications. | |
24 class NativeRunner { | |
25 public: | |
26 virtual ~NativeRunner() {} | |
27 | |
28 // Loads the app in the file at |service_path| and runs it on some other | |
29 // thread/process. Returns a Service handle the service manager can use to | |
30 // connect to the the app. | |
31 virtual mojom::ServicePtr Start( | |
32 const Identity& target, | |
33 bool start_sandboxed, | |
34 const base::Callback<void(base::ProcessId)>& pid_available_callback, | |
35 const base::Closure& service_completed_callback) = 0; | |
36 }; | |
37 | |
38 class NativeRunnerFactory { | |
39 public: | |
40 virtual ~NativeRunnerFactory() {} | |
41 virtual std::unique_ptr<NativeRunner> Create( | |
42 const base::FilePath& service_path) = 0; | |
43 }; | |
44 | |
45 } // namespace service_manager | |
46 | |
47 #endif // SERVICES_SERVICE_MANAGER_NATIVE_RUNNER_H_ | |
OLD | NEW |