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/callback.h" | |
12 #include "base/command_line.h" | |
13 #include "base/process.h" | |
14 | |
15 namespace content { | |
16 | |
17 typedef base::Callback<void(base::ProcessHandle)> StartSandboxedProcessCallback; | |
jam
2012/06/13 16:18:12
why are you using ProcessHandle? I've been trying
michaelbai
2012/06/13 16:23:30
I misunderstood your comment, and will have a anot
| |
18 // Starts a process as a sandboxed process spawned by the Android | |
19 // ActivityManager. | |
20 // The connection object returned may be used with a subsequent call to | |
21 // CancelStartSandboxedProcess(). | |
22 // The created process pid is returned to the |callback| on success, 0 is | |
23 // retuned if the process could not be created. | |
24 base::android::ScopedJavaLocalRef<jobject> StartSandboxedProcess( | |
25 const CommandLine::StringVector& argv, | |
26 int ipc_fd, | |
27 int crash_fd, | |
28 const StartSandboxedProcessCallback& callback); | |
29 | |
30 // Cancel the starting of a sanboxed process. | |
31 // | |
32 // |connection| is the one returned by StartSandboxedProcess. | |
33 void CancelStartSandboxedProcess( | |
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 |