| 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 #ifndef BASE_SYS_INFO_H_ | 5 #ifndef BASE_SYS_INFO_H_ |
| 6 #define BASE_SYS_INFO_H_ | 6 #define BASE_SYS_INFO_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 11 #include "base/time.h" | 13 #include "base/time.h" |
| 12 | 14 #include "build/build_config.h" |
| 13 #include <string> | |
| 14 | |
| 15 class FilePath; | |
| 16 | 15 |
| 17 namespace base { | 16 namespace base { |
| 18 | 17 |
| 19 class BASE_EXPORT SysInfo { | 18 class BASE_EXPORT SysInfo { |
| 20 public: | 19 public: |
| 21 // Return the number of logical processors/cores on the current machine. | 20 // Return the number of logical processors/cores on the current machine. |
| 22 static int NumberOfProcessors(); | 21 static int NumberOfProcessors(); |
| 23 | 22 |
| 24 // Return the number of bytes of physical memory on the current machine. | 23 // Return the number of bytes of physical memory on the current machine. |
| 25 static int64 AmountOfPhysicalMemory(); | 24 static int64 AmountOfPhysicalMemory(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // an empty string is returned. | 58 // an empty string is returned. |
| 60 static std::string CPUModelName(); | 59 static std::string CPUModelName(); |
| 61 | 60 |
| 62 // Return the smallest amount of memory (in bytes) which the VM system will | 61 // Return the smallest amount of memory (in bytes) which the VM system will |
| 63 // allocate. | 62 // allocate. |
| 64 static size_t VMAllocationGranularity(); | 63 static size_t VMAllocationGranularity(); |
| 65 | 64 |
| 66 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 65 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 67 // Returns the maximum SysV shared memory segment size. | 66 // Returns the maximum SysV shared memory segment size. |
| 68 static size_t MaxSharedMemorySize(); | 67 static size_t MaxSharedMemorySize(); |
| 69 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 68 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 70 | 69 |
| 71 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
| 72 // Returns the name of the version entry we wish to look up in the | 71 // Returns the name of the version entry we wish to look up in the |
| 73 // Linux Standard Base release information file. | 72 // Linux Standard Base release information file. |
| 74 static std::string GetLinuxStandardBaseVersionKey(); | 73 static std::string GetLinuxStandardBaseVersionKey(); |
| 75 | 74 |
| 76 // Parses /etc/lsb-release to get version information for Google Chrome OS. | 75 // Parses /etc/lsb-release to get version information for Google Chrome OS. |
| 77 // Declared here so it can be exposed for unit testing. | 76 // Declared here so it can be exposed for unit testing. |
| 78 static void ParseLsbRelease(const std::string& lsb_release, | 77 static void ParseLsbRelease(const std::string& lsb_release, |
| 79 int32* major_version, | 78 int32* major_version, |
| 80 int32* minor_version, | 79 int32* minor_version, |
| 81 int32* bugfix_version); | 80 int32* bugfix_version); |
| 82 | 81 |
| 83 // Returns the path to the lsb-release file. | 82 // Returns the path to the lsb-release file. |
| 84 static FilePath GetLsbReleaseFilePath(); | 83 static FilePath GetLsbReleaseFilePath(); |
| 85 #endif // defined(OS_CHROMEOS) | 84 #endif // defined(OS_CHROMEOS) |
| 86 | 85 |
| 87 #if defined(OS_ANDROID) | 86 #if defined(OS_ANDROID) |
| 88 // Returns the Android build's codename. | 87 // Returns the Android build's codename. |
| 89 static std::string GetAndroidBuildCodename(); | 88 static std::string GetAndroidBuildCodename(); |
| 90 | 89 |
| 91 // Returns the Android build ID. | 90 // Returns the Android build ID. |
| 92 static std::string GetAndroidBuildID(); | 91 static std::string GetAndroidBuildID(); |
| 93 | 92 |
| 94 // Returns the device's name. | 93 // Returns the device's name. |
| 95 static std::string GetDeviceName(); | 94 static std::string GetDeviceName(); |
| 96 | 95 |
| 97 static int DalvikHeapSizeMB(); | 96 static int DalvikHeapSizeMB(); |
| 98 #endif // defined(OS_ANDROID) | 97 #endif // defined(OS_ANDROID) |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 } // namespace base | 100 } // namespace base |
| 102 | 101 |
| 103 #endif // BASE_SYS_INFO_H_ | 102 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |