OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ | |
6 #define CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "base/command_line.h" | |
12 #include "base/process.h" | |
13 | |
14 namespace content { | |
15 | |
16 class SandboxedProcessClient { | |
jam
2012/06/12 17:24:11
nit: now that we have the powerful bind callbacks,
michaelbai
2012/06/12 19:44:26
Done.
| |
17 public: | |
18 // Called back when the process was created with the process pid, or 0 | |
19 // if the process could not be created. | |
20 virtual void OnSandboxedProcessStarted(base::ProcessHandle handle) = 0; | |
jam
2012/06/12 17:24:11
nit: since you say "process id" above, you probabl
michaelbai
2012/06/12 19:44:26
Done.
| |
21 }; | |
22 | |
23 // Starts a process as a sandboxed process spawned by the Android | |
24 // ActivityManager. | |
25 // The connection object returned may be used with a subsequent call to | |
26 // CancelStartSandboxedProcess() | |
27 base::android::ScopedJavaLocalRef<jobject> StartSandboxedProcess( | |
28 const CommandLine::StringVector& argv, | |
29 int ipc_fd, | |
30 int crash_fd, | |
31 SandboxedProcessClient* client); | |
32 | |
33 void CancelStartSandboxedProcess( | |
jam
2012/06/12 17:24:11
nit: add comment
michaelbai
2012/06/12 19:44:26
Done.
| |
34 const base::android::JavaRef<jobject>& connection); | |
35 | |
36 // Stops a sandboxed process based on the handle returned form | |
37 // StartSandboxedProcess. | |
38 void StopSandboxedProcess(base::ProcessHandle handle); | |
39 | |
40 // Registers JNI methods, this must be called before any other methods in this | |
41 // file. | |
42 bool RegisterSandboxedProcessLauncher(JNIEnv* env); | |
43 | |
44 } // namespace content | |
45 | |
46 #endif // CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ | |
OLD | NEW |