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

Unified Diff: base/android/java/src/org/chromium/base/SysUtils.java

Issue 665273003: [Android] Initialize CommandLine before any usage in Render. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: add comments, turn a check into assert in SysUtils.detectLowEndDevice Created 6 years, 2 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/app/ChildProcessService.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/SysUtils.java
diff --git a/base/android/java/src/org/chromium/base/SysUtils.java b/base/android/java/src/org/chromium/base/SysUtils.java
index eabef61c9e18469f7417d9e52c60a0e90773fb03..1c8378c1255dfe7dbe836e1f84e01ac0e1a88864 100644
--- a/base/android/java/src/org/chromium/base/SysUtils.java
+++ b/base/android/java/src/org/chromium/base/SysUtils.java
@@ -103,13 +103,12 @@ public class SysUtils {
}
private static boolean detectLowEndDevice() {
- if (CommandLine.isInitialized()) {
- if (CommandLine.getInstance().hasSwitch(BaseSwitches.LOW_END_DEVICE_MODE)) {
- int mode = Integer.parseInt(CommandLine.getInstance().getSwitchValue(
- BaseSwitches.LOW_END_DEVICE_MODE));
- if (mode == 1) return true;
- if (mode == 0) return false;
- }
+ assert CommandLine.isInitialized();
nyquist 2014/10/23 22:30:48 How does this work for the ChildProcessLauncher?
Feng Qian 2014/10/23 22:57:26 ChildProcessLauncher is called in browser process
nyquist 2014/10/24 18:14:42 The class is initialized whenever: - An instance
Feng Qian 2014/10/27 16:09:16 Yes, that's intended, we want to catch all cases w
+ if (CommandLine.getInstance().hasSwitch(BaseSwitches.LOW_END_DEVICE_MODE)) {
+ int mode = Integer.parseInt(CommandLine.getInstance().getSwitchValue(
+ BaseSwitches.LOW_END_DEVICE_MODE));
+ if (mode == 1) return true;
+ if (mode == 0) return false;
}
if (Build.VERSION.SDK_INT <= ANDROID_LOW_MEMORY_ANDROID_SDK_THRESHOLD) {
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/app/ChildProcessService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698