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

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

Issue 258663002: Expose a low-end device mode override flags for non-android OSs as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline again Created 6 years, 6 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
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 a8fcdcb8169df1710447d0be0cfb2b0501f5a2c2..651b1718dc9166b0979e38bd350aa1e01d6f01d3 100644
--- a/base/android/java/src/org/chromium/base/SysUtils.java
+++ b/base/android/java/src/org/chromium/base/SysUtils.java
@@ -38,7 +38,6 @@ public class SysUtils {
*
* Note that this is CalledByNative for testing purpose only.
*/
- @CalledByNative
public static int amountOfPhysicalMemoryKB() {
// Extract total memory RAM size by parsing /proc/meminfo, note that
// this is exactly what the implementation of sysconf(_SC_PHYS_PAGES)
@@ -108,11 +107,13 @@ public class SysUtils {
private static boolean detectLowEndDevice() {
if (CommandLine.isInitialized()) {
- if (CommandLine.getInstance().hasSwitch(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE)) {
- return true;
- }
- if (CommandLine.getInstance().hasSwitch(BaseSwitches.DISABLE_LOW_END_DEVICE_MODE)) {
- return false;
+ 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;
}
}

Powered by Google App Engine
This is Rietveld 408576698