Chromium Code Reviews| Index: content/browser/android/sandboxed_process_launcher.h |
| diff --git a/content/browser/android/sandboxed_process_launcher.h b/content/browser/android/sandboxed_process_launcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8883d27794fdf8f5a961c9f6f2133f74ad5126da |
| --- /dev/null |
| +++ b/content/browser/android/sandboxed_process_launcher.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ |
| +#define CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ |
| + |
| +#include <jni.h> |
| + |
| +#include "base/android/scoped_java_ref.h" |
| +#include "base/callback.h" |
| +#include "base/command_line.h" |
| +#include "base/process.h" |
| + |
| +namespace content { |
| + |
| +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
|
| +// Starts a process as a sandboxed process spawned by the Android |
| +// ActivityManager. |
| +// The connection object returned may be used with a subsequent call to |
| +// CancelStartSandboxedProcess(). |
| +// The created process pid is returned to the |callback| on success, 0 is |
| +// retuned if the process could not be created. |
| +base::android::ScopedJavaLocalRef<jobject> StartSandboxedProcess( |
| + const CommandLine::StringVector& argv, |
| + int ipc_fd, |
| + int crash_fd, |
| + const StartSandboxedProcessCallback& callback); |
| + |
| +// Cancel the starting of a sanboxed process. |
| +// |
| +// |connection| is the one returned by StartSandboxedProcess. |
| +void CancelStartSandboxedProcess( |
| + const base::android::JavaRef<jobject>& connection); |
| + |
| +// Stops a sandboxed process based on the handle returned form |
| +// StartSandboxedProcess. |
| +void StopSandboxedProcess(base::ProcessHandle handle); |
| + |
| +// Registers JNI methods, this must be called before any other methods in this |
| +// file. |
| +bool RegisterSandboxedProcessLauncher(JNIEnv* env); |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ |