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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/android/sandboxed_process_launcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.RemoteException; 8 import android.os.RemoteException;
9 import android.util.Log; 9 import android.util.Log;
10 import android.view.Surface; 10 import android.view.Surface;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 final int clientContext) { 173 final int clientContext) {
174 assert clientContext != 0; 174 assert clientContext != 0;
175 SandboxedProcessConnection allocatedConnection; 175 SandboxedProcessConnection allocatedConnection;
176 synchronized (SandboxedProcessLauncher.class) { 176 synchronized (SandboxedProcessLauncher.class) {
177 allocatedConnection = mSpareConnection; 177 allocatedConnection = mSpareConnection;
178 mSpareConnection = null; 178 mSpareConnection = null;
179 } 179 }
180 if (allocatedConnection == null) { 180 if (allocatedConnection == null) {
181 allocatedConnection = allocateBoundConnection(context, commandLine); 181 allocatedConnection = allocateBoundConnection(context, commandLine);
182 if (allocatedConnection == null) { 182 if (allocatedConnection == null) {
183 // Notify the native code so it can free the heap allocated call back.
184 nativeOnSandboxedProcessStarted(clientContext, 0);
183 return; 185 return;
184 } 186 }
185 } 187 }
186 final SandboxedProcessConnection connection = allocatedConnection; 188 final SandboxedProcessConnection connection = allocatedConnection;
187 Log.d(TAG, "Setting up connection to process: slot=" + connection.getSer viceNumber()); 189 Log.d(TAG, "Setting up connection to process: slot=" + connection.getSer viceNumber());
188 // Note: This runnable will be executed when the sandboxed connection is setup. 190 // Note: This runnable will be executed when the sandboxed connection is setup.
189 final Runnable onConnect = new Runnable() { 191 final Runnable onConnect = new Runnable() {
190 @Override 192 @Override
191 public void run() { 193 public void run() {
192 final int pid = connection.getPid(); 194 final int pid = connection.getPid();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // avoid waiting for the finalizer to get around to it. 292 // avoid waiting for the finalizer to get around to it.
291 if (surface != null) { 293 if (surface != null) {
292 surface.release(); 294 surface.release();
293 } 295 }
294 } 296 }
295 }; 297 };
296 }; 298 };
297 299
298 private static native void nativeOnSandboxedProcessStarted(int clientContext , int pid); 300 private static native void nativeOnSandboxedProcessStarted(int clientContext , int pid);
299 } 301 }
OLDNEW
« no previous file with comments | « content/browser/android/sandboxed_process_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698