| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/file_path.h" |
| 12 #include "base/time.h" |
| 11 | 13 |
| 12 #include <string> | 14 #include <string> |
| 13 | 15 |
| 14 class FilePath; | 16 class FilePath; |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 | 19 |
| 18 class BASE_EXPORT SysInfo { | 20 class BASE_EXPORT SysInfo { |
| 19 public: | 21 public: |
| 20 // Return the number of logical processors/cores on the current machine. | 22 // Return the number of logical processors/cores on the current machine. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // across platforms. | 56 // across platforms. |
| 55 static std::string CPUArchitecture(); | 57 static std::string CPUArchitecture(); |
| 56 | 58 |
| 57 // Return the smallest amount of memory (in bytes) which the VM system will | 59 // Return the smallest amount of memory (in bytes) which the VM system will |
| 58 // allocate. | 60 // allocate. |
| 59 static size_t VMAllocationGranularity(); | 61 static size_t VMAllocationGranularity(); |
| 60 | 62 |
| 61 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 63 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 62 // Returns the maximum SysV shared memory segment size. | 64 // Returns the maximum SysV shared memory segment size. |
| 63 static size_t MaxSharedMemorySize(); | 65 static size_t MaxSharedMemorySize(); |
| 64 #endif | 66 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 65 | 67 |
| 66 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) |
| 67 // Returns the name of the version entry we wish to look up in the | 69 // Returns the name of the version entry we wish to look up in the |
| 68 // Linux Standard Base release information file. | 70 // Linux Standard Base release information file. |
| 69 static std::string GetLinuxStandardBaseVersionKey(); | 71 static std::string GetLinuxStandardBaseVersionKey(); |
| 70 | 72 |
| 71 // Parses /etc/lsb-release to get version information for Google Chrome OS. | 73 // Parses /etc/lsb-release to get version information for Google Chrome OS. |
| 72 // Declared here so it can be exposed for unit testing. | 74 // Declared here so it can be exposed for unit testing. |
| 73 static void ParseLsbRelease(const std::string& lsb_release, | 75 static void ParseLsbRelease(const std::string& lsb_release, |
| 74 int32* major_version, | 76 int32* major_version, |
| 75 int32* minor_version, | 77 int32* minor_version, |
| 76 int32* bugfix_version); | 78 int32* bugfix_version); |
| 77 #endif | 79 |
| 80 // Returns the path to the lsb-release file. |
| 81 static FilePath GetLsbReleaseFilePath(); |
| 82 #endif // defined(OS_CHROMEOS) |
| 78 }; | 83 }; |
| 79 | 84 |
| 80 } // namespace base | 85 } // namespace base |
| 81 | 86 |
| 82 #endif // BASE_SYS_INFO_H_ | 87 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |