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

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

Issue 10913085: Ensure we don't leak a callback object when starting a sandboxed process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/sandboxed_process_launcher.cc
diff --git a/content/browser/android/sandboxed_process_launcher.cc b/content/browser/android/sandboxed_process_launcher.cc
index f46f2bbb4d06fad518fb40175a7205c8c202a5d2..04d3512f693b2fbcb615138d464e37493ce412f0 100644
--- a/content/browser/android/sandboxed_process_launcher.cc
+++ b/content/browser/android/sandboxed_process_launcher.cc
@@ -22,14 +22,16 @@ namespace content {
// started.
// |client_context| is the pointer to StartSandboxedProcessCallback which was
// passed in from StartSandboxedProcess.
-// |handle| is the processID of the child process as originated in Java.
+// |handle| is the processID of the child process as originated in Java, 0 if
+// the SandboxedProcess could not be created.
static void OnSandboxedProcessStarted(JNIEnv*,
jclass,
jint client_context,
jint handle) {
StartSandboxedProcessCallback* callback =
reinterpret_cast<StartSandboxedProcessCallback*>(client_context);
- callback->Run(static_cast<base::ProcessHandle>(handle));
+ if (handle)
+ callback->Run(static_cast<base::ProcessHandle>(handle));
delete callback;
}
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698