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

Unified Diff: content/browser/android/sandboxed_process_launcher.h

Issue 10541110: Added sandboxed process launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
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..02259d14850f4db679421f408869075d256e189f
--- /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/command_line.h"
+#include "base/process.h"
+
+namespace content {
+
+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.
+ public:
+ // Called back when the process was created with the process pid, or 0
+ // if the process could not be created.
+ 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.
+};
+
+// 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()
+base::android::ScopedJavaLocalRef<jobject> StartSandboxedProcess(
+ const CommandLine::StringVector& argv,
+ int ipc_fd,
+ int crash_fd,
+ SandboxedProcessClient* client);
+
+void CancelStartSandboxedProcess(
jam 2012/06/12 17:24:11 nit: add comment
michaelbai 2012/06/12 19:44:26 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698