Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
index 1b653d0e3be16af432ffa89e2118b2d9ca072414..a719ac1ef0e4d53826e6b6a690b2cb23e8fabc40 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java |
@@ -13,7 +13,9 @@ import android.view.Surface; |
import com.google.common.annotations.VisibleForTesting; |
+import org.chromium.base.BaseSwitches; |
import org.chromium.base.CalledByNative; |
+import org.chromium.base.CommandLine; |
import org.chromium.base.JNINamespace; |
import org.chromium.base.ThreadUtils; |
import org.chromium.base.TraceEvent; |
@@ -26,6 +28,7 @@ import org.chromium.content.common.IChildProcessCallback; |
import org.chromium.content.common.SurfaceWrapper; |
import java.util.ArrayList; |
+import java.util.Arrays; |
import java.util.Map; |
import java.util.concurrent.ConcurrentHashMap; |
@@ -358,13 +361,20 @@ public class ChildProcessLauncher { |
int callbackType = CALLBACK_FOR_UNKNOWN_PROCESS; |
boolean inSandbox = true; |
String processType = getSwitchValue(commandLine, SWITCH_PROCESS_TYPE); |
+ ArrayList<String> cmdList = commandLine == null ? new ArrayList<String>() : |
+ new ArrayList<String>(Arrays.asList(commandLine)); |
Feng Qian
2014/08/27 17:45:29
We should put render command line options in one p
Jaekyun Seok (inactive)
2014/08/28 00:09:49
Done.
|
if (SWITCH_RENDERER_PROCESS.equals(processType)) { |
+ if (CommandLine.getInstance().hasSwitch( |
+ BaseSwitches.WAIT_RENDERER_FOR_JAVA_DEBUGGER)) { |
+ cmdList.add("--" + BaseSwitches.WAIT_FOR_JAVA_DEBUGGER); |
+ } |
callbackType = CALLBACK_FOR_RENDERER_PROCESS; |
} else if (SWITCH_GPU_PROCESS.equals(processType)) { |
callbackType = CALLBACK_FOR_GPU_PROCESS; |
} else if (SWITCH_PPAPI_BROKER_PROCESS.equals(processType)) { |
inSandbox = false; |
} |
+ String[] updatedCommandLine = cmdList.toArray(new String[0]); |
ChildProcessConnection allocatedConnection = null; |
synchronized (ChildProcessLauncher.class) { |
@@ -374,7 +384,7 @@ public class ChildProcessLauncher { |
} |
} |
if (allocatedConnection == null) { |
- allocatedConnection = allocateBoundConnection(context, commandLine, inSandbox); |
+ allocatedConnection = allocateBoundConnection(context, updatedCommandLine, inSandbox); |
if (allocatedConnection == null) { |
// Notify the native code so it can free the heap allocated callback. |
nativeOnChildProcessStarted(clientContext, 0); |
@@ -386,8 +396,8 @@ public class ChildProcessLauncher { |
Log.d(TAG, "Setting up connection to process: slot=" + |
allocatedConnection.getServiceNumber()); |
- triggerConnectionSetup(allocatedConnection, commandLine, childProcessId, filesToBeMapped, |
- callbackType, clientContext); |
+ triggerConnectionSetup(allocatedConnection, updatedCommandLine, childProcessId, |
+ filesToBeMapped, callbackType, clientContext); |
TraceEvent.end(); |
} |