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

Side by Side Diff: base/android/sys_utils.cc

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jochen's nits. Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/android/sys_utils.h" 5 #include "base/android/sys_utils.h"
6 6
7 #include "base/android/sys_utils_constants.h"
7 #include "base/sys_info.h" 8 #include "base/sys_info.h"
8 #include "jni/SysUtils_jni.h" 9 #include "jni/SysUtils_jni.h"
9 10
10 const int64 kLowEndMemoryThreshold = 1024 * 1024 * 512; // 512 mb.
11
12 // Defined and called by JNI 11 // Defined and called by JNI
13 static jboolean IsLowEndDevice(JNIEnv* env, jclass clazz) { 12 static jboolean IsLowEndDevice(JNIEnv* env, jclass clazz) {
14 return base::android::SysUtils::IsLowEndDevice(); 13 return base::android::SysUtils::IsLowEndDevice();
15 } 14 }
16 15
17 namespace base { 16 namespace base {
18 namespace android { 17 namespace android {
19 18
20 bool SysUtils::Register(JNIEnv* env) { 19 const int64 kLowEndMemoryThreshold =
21 return RegisterNativesImpl(env); 20 BASE_ANDROID_LOW_END_MEMORY_THRESHOLD_MB * 1024 * 1024;
22 } 21
22 bool SysUtils::Register(JNIEnv* env) { return RegisterNativesImpl(env); }
23 23
24 bool SysUtils::IsLowEndDevice() { 24 bool SysUtils::IsLowEndDevice() {
25 return SysInfo::AmountOfPhysicalMemory() <= kLowEndMemoryThreshold; 25 return SysInfo::AmountOfPhysicalMemory() <= kLowEndMemoryThreshold;
26 } 26 }
27 27
28 SysUtils::SysUtils() { } 28 SysUtils::SysUtils() { }
29 29
30 } // namespace android 30 } // namespace android
31 } // namespace base 31 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698