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

Unified Diff: base/android/sys_utils_android.cc

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: Forward command-line flags to renderer and gpu processes Created 6 years, 8 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/sys_utils_android.cc
diff --git a/base/android/sys_utils_android.cc b/base/android/sys_utils_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cd9c6b27b2c75ae67481d50d1b1ee95d83eadf70
--- /dev/null
+++ b/base/android/sys_utils_android.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/sys_utils_android.h"
+
+#include "base/android/build_info.h"
+#include "base/sys_info.h"
+#include "jni/SysUtils_jni.h"
+
+namespace base {
+namespace android {
+
+bool SysUtilsAndroid::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+bool SysUtilsAndroid::IsLowEndDeviceFromJni() {
+ JNIEnv* env = AttachCurrentThread();
+ return Java_SysUtils_isLowEndDevice(env);
+}
+} // namespace android
+
+static base::LazyInstance<
+ base::internal::LazySysInfoValue<bool,
+ android::SysUtilsAndroid::IsLowEndDeviceFromJni> >::Leaky
+ g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER;
+
+bool SysUtils::IsLowEndDevice() {
+ return g_lazy_low_end_device.Get().value();
+}
+} // namespace base
+

Powered by Google App Engine
This is Rietveld 408576698