| 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_api.h" | 9 #include "base/base_api.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Returns the name of the host operating system. | 35 // Returns the name of the host operating system. |
| 36 static std::string OperatingSystemName(); | 36 static std::string OperatingSystemName(); |
| 37 | 37 |
| 38 // Returns the version of the host operating system. | 38 // Returns the version of the host operating system. |
| 39 static std::string OperatingSystemVersion(); | 39 static std::string OperatingSystemVersion(); |
| 40 | 40 |
| 41 // Retrieves detailed numeric values for the OS version. | 41 // Retrieves detailed numeric values for the OS version. |
| 42 // TODO(port): Implement a Linux version of this method and enable the | 42 // TODO(port): Implement a Linux version of this method and enable the |
| 43 // corresponding unit test. | 43 // corresponding unit test. |
| 44 static void OperatingSystemVersionNumbers(int32* major_version, | 44 static void OperatingSystemVersionNumbers(int32 *major_version, |
| 45 int32* minor_version, | 45 int32 *minor_version, |
| 46 int32* bugfix_version); | 46 int32 *bugfix_version); |
| 47 | 47 |
| 48 // Returns the CPU architecture of the system. Exact return value may differ | 48 // Returns the CPU architecture of the system. Exact return value may differ |
| 49 // across platforms. | 49 // across platforms. |
| 50 static std::string CPUArchitecture(); | 50 static std::string CPUArchitecture(); |
| 51 | 51 |
| 52 // Returns the pixel dimensions of the primary display via the | 52 // Returns the pixel dimensions of the primary display via the |
| 53 // width and height parameters. | 53 // width and height parameters. |
| 54 static void GetPrimaryDisplayDimensions(int* width, int* height); | 54 static void GetPrimaryDisplayDimensions(int* width, int* height); |
| 55 | 55 |
| 56 // Return the number of displays. | 56 // Return the number of displays. |
| 57 static int DisplayCount(); | 57 static int DisplayCount(); |
| 58 | 58 |
| 59 // 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 |
| 60 // allocate. | 60 // allocate. |
| 61 static size_t VMAllocationGranularity(); | 61 static size_t VMAllocationGranularity(); |
| 62 | 62 |
| 63 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 63 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 64 // Returns the maximum SysV shared memory segment size. | 64 // Returns the maximum SysV shared memory segment size. |
| 65 static size_t MaxSharedMemorySize(); | 65 static size_t MaxSharedMemorySize(); |
| 66 #endif | 66 #endif |
| 67 | 67 |
| 68 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) |
| 69 // 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 |
| 70 // Linux Standard Base release information file. | 70 // Linux Standard Base release information file. |
| 71 static std::string GetLinuxStandardBaseVersionKey(); | 71 static std::string GetLinuxStandardBaseVersionKey(); |
| 72 | 72 |
| 73 // 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. |
| 74 // Declared here so it can be exposed for unit testing. | 74 // Declared here so it can be exposed for unit testing. |
| 75 static void ParseLsbRelease(const std::string& lsb_release, | 75 static void ParseLsbRelease(const std::string& lsb_release, |
| 76 int32* major_version, | 76 int32 *major_version, |
| 77 int32* minor_version, | 77 int32 *minor_version, |
| 78 int32* bugfix_version); | 78 int32 *bugfix_version); |
| 79 #endif | 79 #endif |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace base | 82 } // namespace base |
| 83 | 83 |
| 84 #endif // BASE_SYS_INFO_H_ | 84 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |