Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: mojo/shell/native_runner.h

Issue 1722743002: Adds ability for chrome to behave as mojo_runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to tip of tree Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13
14 #if defined(OS_WIN) 14 #if defined(OS_WIN)
15 #undef DELETE 15 #undef DELETE
16 #endif 16 #endif
17 17
18 namespace base { 18 namespace base {
19 class FilePath; 19 class FilePath;
20 } 20 }
21 21
22 namespace mojo { 22 namespace mojo {
23 namespace shell { 23 namespace shell {
24 24
25 class Identity;
26
25 // ApplicationManager requires implementations of NativeRunner and 27 // ApplicationManager requires implementations of NativeRunner and
26 // NativeRunnerFactory to run native applications. 28 // NativeRunnerFactory to run native applications.
27 class NativeRunner { 29 class NativeRunner {
28 public: 30 public:
29 virtual ~NativeRunner() {} 31 virtual ~NativeRunner() {}
30 32
31 // Loads the app in the file at |app_path| and runs it on some other 33 // Loads the app in the file at |app_path| and runs it on some other
32 // thread/process. 34 // thread/process.
33 virtual void Start( 35 virtual void Start(
34 const base::FilePath& app_path, 36 const base::FilePath& app_path,
37 const Identity& target,
35 bool start_sandboxed, 38 bool start_sandboxed,
36 InterfaceRequest<mojom::ShellClient> request, 39 InterfaceRequest<mojom::ShellClient> request,
37 const base::Callback<void(base::ProcessId)>& pid_available_callback, 40 const base::Callback<void(base::ProcessId)>& pid_available_callback,
38 const base::Closure& app_completed_callback) = 0; 41 const base::Closure& app_completed_callback) = 0;
39 42
40 // Like Start(), but used to initialize the host for a child process started 43 // Like Start(), but used to initialize the host for a child process started
41 // by someone else. Provides |request| via |channel|. 44 // by someone else. Provides |request| via |channel|.
42 virtual void InitHost(ScopedHandle channel, 45 virtual void InitHost(ScopedHandle channel,
43 InterfaceRequest<mojom::ShellClient> request) = 0; 46 InterfaceRequest<mojom::ShellClient> request) = 0;
44 }; 47 };
45 48
46 class NativeRunnerFactory { 49 class NativeRunnerFactory {
47 public: 50 public:
48 virtual ~NativeRunnerFactory() {} 51 virtual ~NativeRunnerFactory() {}
49 virtual scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) = 0; 52 virtual scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) = 0;
50 }; 53 };
51 54
52 } // namespace shell 55 } // namespace shell
53 } // namespace mojo 56 } // namespace mojo
54 57
55 #endif // MOJO_SHELL_NATIVE_RUNNER_H_ 58 #endif // MOJO_SHELL_NATIVE_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698