OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sys_info.h" | 5 #include "base/sys_info.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <sys/system_properties.h> | 10 #include <sys/system_properties.h> |
11 | 11 |
12 #include "base/android/jni_android.h" | |
12 #include "base/android/sys_utils.h" | 13 #include "base/android/sys_utils.h" |
13 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
18 #include "base/sys_info_internal.h" | 19 #include "base/sys_info_internal.h" |
19 | 20 |
20 #if (__ANDROID_API__ >= 21 /* 5.0 - Lollipop */) | 21 #if (__ANDROID_API__ >= 21 /* 5.0 - Lollipop */) |
21 | 22 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 static int heap_growth_limit = GetDalvikHeapGrowthLimitMB(); | 209 static int heap_growth_limit = GetDalvikHeapGrowthLimitMB(); |
209 return heap_growth_limit; | 210 return heap_growth_limit; |
210 } | 211 } |
211 | 212 |
212 static base::LazyInstance< | 213 static base::LazyInstance< |
213 base::internal::LazySysInfoValue<bool, | 214 base::internal::LazySysInfoValue<bool, |
214 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky | 215 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky |
215 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; | 216 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; |
216 | 217 |
217 bool SysInfo::IsLowEndDevice() { | 218 bool SysInfo::IsLowEndDevice() { |
219 // When command buffer is compiled as a standalone library, the process | |
Yaron
2016/03/05 01:31:05
I don't think this comment makes sense here. It's
| |
220 // might not have a Java environment. | |
221 if (!base::android::IsVMInitialized()) | |
222 return false; | |
218 return g_lazy_low_end_device.Get().value(); | 223 return g_lazy_low_end_device.Get().value(); |
219 } | 224 } |
220 | 225 |
221 | 226 |
222 } // namespace base | 227 } // namespace base |
OLD | NEW |