Commit d7929e7e authored by jaekyun's avatar jaekyun Committed by Commit bot

Add a flag to let render process wait for java debugger

A switch RENDERER_WAIT_FOR_JAVA_DEBUGGER is newly added to block
ChildProcessMain thread of ChildProcessService until a Java debugger is
attached.

BUG=378975

Review URL: https://codereview.chromium.org/511683003

Cr-Commit-Position: refs/heads/master@{#292733}
parent 95c7a163
...@@ -12,6 +12,9 @@ public abstract class BaseSwitches { ...@@ -12,6 +12,9 @@ public abstract class BaseSwitches {
// Block onCreate() of Chrome until a Java debugger is attached. // Block onCreate() of Chrome until a Java debugger is attached.
public static final String WAIT_FOR_JAVA_DEBUGGER = "wait-for-java-debugger"; public static final String WAIT_FOR_JAVA_DEBUGGER = "wait-for-java-debugger";
// Block ChildProcessMain thread of render process service until a Java debugger is attached.
public static final String RENDERER_WAIT_FOR_JAVA_DEBUGGER = "renderer-wait-for-java-debugger";
// Force low-end device when set to 1; // Force low-end device when set to 1;
// Force non-low-end device when set to 0; // Force non-low-end device when set to 0;
// Auto-detect low-end device when set to other values or empty; // Auto-detect low-end device when set to other values or empty;
......
...@@ -1248,6 +1248,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( ...@@ -1248,6 +1248,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kMediaDrmEnableNonCompositing, switches::kMediaDrmEnableNonCompositing,
switches::kNetworkCountryIso, switches::kNetworkCountryIso,
switches::kDisableWebAudio, switches::kDisableWebAudio,
switches::kRendererWaitForJavaDebugger,
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Allow this to be set when invoking the browser and relayed along. // Allow this to be set when invoking the browser and relayed along.
......
...@@ -16,6 +16,7 @@ import android.os.RemoteException; ...@@ -16,6 +16,7 @@ import android.os.RemoteException;
import android.util.Log; import android.util.Log;
import android.view.Surface; import android.view.Surface;
import org.chromium.base.BaseSwitches;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
...@@ -154,6 +155,11 @@ public class ChildProcessService extends Service { ...@@ -154,6 +155,11 @@ public class ChildProcessService extends Service {
} }
} }
CommandLine.init(mCommandLineParams); CommandLine.init(mCommandLineParams);
if (CommandLine.getInstance().hasSwitch(
BaseSwitches.RENDERER_WAIT_FOR_JAVA_DEBUGGER)) {
android.os.Debug.waitForDebugger();
}
try { try {
LibraryLoader.loadNow(getApplicationContext(), false); LibraryLoader.loadNow(getApplicationContext(), false);
isLoaded = true; isLoaded = true;
......
...@@ -889,6 +889,10 @@ const char kNetworkCountryIso[] = "network-country-iso"; ...@@ -889,6 +889,10 @@ const char kNetworkCountryIso[] = "network-country-iso";
// Enables remote debug over HTTP on the specified socket name. // Enables remote debug over HTTP on the specified socket name.
const char kRemoteDebuggingSocketName[] = "remote-debugging-socket-name"; const char kRemoteDebuggingSocketName[] = "remote-debugging-socket-name";
// Block ChildProcessMain thread of the renderer's ChildProcessService until a
// Java debugger is attached.
const char kRendererWaitForJavaDebugger[] = "renderer-wait-for-java-debugger";
#endif #endif
// Disable web audio API. // Disable web audio API.
......
...@@ -256,6 +256,7 @@ CONTENT_EXPORT extern const char kForceUseOverlayEmbeddedVideo[]; ...@@ -256,6 +256,7 @@ CONTENT_EXPORT extern const char kForceUseOverlayEmbeddedVideo[];
CONTENT_EXPORT extern const char kHideScrollbars[]; CONTENT_EXPORT extern const char kHideScrollbars[];
extern const char kNetworkCountryIso[]; extern const char kNetworkCountryIso[];
CONTENT_EXPORT extern const char kRemoteDebuggingSocketName[]; CONTENT_EXPORT extern const char kRemoteDebuggingSocketName[];
CONTENT_EXPORT extern const char kRendererWaitForJavaDebugger[];
#endif #endif
CONTENT_EXPORT extern const char kDisableWebAudio[]; CONTENT_EXPORT extern const char kDisableWebAudio[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment