Index: content/public/android/java/src/org/chromium/content/common/ContentSwitches.java |
diff --git a/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java b/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java |
index 8fc8302513eec6206d3a2064eca42b7f991be414..899d48f072ced99e76a03463830e5941a44f99fe 100644 |
--- a/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java |
+++ b/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java |
@@ -72,6 +72,35 @@ public abstract class ContentSwitches { |
// Native switch kIPCSyncCompositing |
public static final String IPC_SYNC_COMPOSITING = "ipc-sync-compositing"; |
+ // Native switch kProcessType |
+ public static final String SWITCH_PROCESS_TYPE = "type"; |
+ |
+ // Native switch kRendererProcess |
+ public static final String SWITCH_RENDERER_PROCESS = "renderer"; |
+ |
+ // Native switch kUtilityProcess |
+ public static final String SWITCH_UTILITY_PROCESS = "utility"; |
+ |
+ // Native switch kGPUProcess |
+ public static final String SWITCH_GPU_PROCESS = "gpu-process"; |
+ |
+ // Native switch kDownloadProcess |
+ public static final String SWITCH_DOWNLOAD_PROCESS = "download"; |
+ |
// Prevent instantiation. |
private ContentSwitches() {} |
+ |
+ public static String getSwitchValue(final String[] commandLine, String switchKey) { |
+ if (commandLine == null || switchKey == null) { |
+ return null; |
+ } |
+ // This format should be matched with the one defined in command_line.h. |
+ final String switchKeyPrefix = "--" + switchKey + "="; |
+ for (String command : commandLine) { |
+ if (command != null && command.startsWith(switchKeyPrefix)) { |
+ return command.substring(switchKeyPrefix.length()); |
+ } |
+ } |
+ return null; |
+ } |
} |