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 <sys/system_properties.h> | 8 #include <sys/system_properties.h> |
9 | 9 |
10 #include "base/android/sys_utils.h" | 10 #include "base/android/sys_utils.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 result = base::SysInfo::AmountOfPhysicalMemoryMB() / 6; | 148 result = base::SysInfo::AmountOfPhysicalMemoryMB() / 6; |
149 } | 149 } |
150 result = std::min<int64>(std::max<int64>(16 * MB, result), 512 * MB) / MB; | 150 result = std::min<int64>(std::max<int64>(16 * MB, result), 512 * MB) / MB; |
151 return static_cast<int>(result); | 151 return static_cast<int>(result); |
152 } | 152 } |
153 | 153 |
154 } // anonymous namespace | 154 } // anonymous namespace |
155 | 155 |
156 namespace base { | 156 namespace base { |
157 | 157 |
| 158 bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) { |
| 159 // Find a case where this is incorrect and dbeam@ will buy you a beer. |
| 160 *has_seek_penalty = false; |
| 161 return true; |
| 162 } |
| 163 |
158 std::string SysInfo::OperatingSystemName() { | 164 std::string SysInfo::OperatingSystemName() { |
159 return "Android"; | 165 return "Android"; |
160 } | 166 } |
161 | 167 |
162 std::string SysInfo::GetAndroidBuildCodename() { | 168 std::string SysInfo::GetAndroidBuildCodename() { |
163 char os_version_codename_str[PROP_VALUE_MAX]; | 169 char os_version_codename_str[PROP_VALUE_MAX]; |
164 __system_property_get("ro.build.version.codename", os_version_codename_str); | 170 __system_property_get("ro.build.version.codename", os_version_codename_str); |
165 return std::string(os_version_codename_str); | 171 return std::string(os_version_codename_str); |
166 } | 172 } |
167 | 173 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 base::internal::LazySysInfoValue<bool, | 215 base::internal::LazySysInfoValue<bool, |
210 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky | 216 android::SysUtils::IsLowEndDeviceFromJni> >::Leaky |
211 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; | 217 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; |
212 | 218 |
213 bool SysInfo::IsLowEndDevice() { | 219 bool SysInfo::IsLowEndDevice() { |
214 return g_lazy_low_end_device.Get().value(); | 220 return g_lazy_low_end_device.Get().value(); |
215 } | 221 } |
216 | 222 |
217 | 223 |
218 } // namespace base | 224 } // namespace base |
OLD | NEW |