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/time.h" |
11 | 12 |
12 #include <string> | 13 #include <string> |
13 | 14 |
14 class FilePath; | 15 class FilePath; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 | 18 |
18 class BASE_EXPORT SysInfo { | 19 class BASE_EXPORT SysInfo { |
19 public: | 20 public: |
20 // Return the number of logical processors/cores on the current machine. | 21 // 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. | 55 // across platforms. |
55 static std::string CPUArchitecture(); | 56 static std::string CPUArchitecture(); |
56 | 57 |
57 // Return the smallest amount of memory (in bytes) which the VM system will | 58 // Return the smallest amount of memory (in bytes) which the VM system will |
58 // allocate. | 59 // allocate. |
59 static size_t VMAllocationGranularity(); | 60 static size_t VMAllocationGranularity(); |
60 | 61 |
61 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 62 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
62 // Returns the maximum SysV shared memory segment size. | 63 // Returns the maximum SysV shared memory segment size. |
63 static size_t MaxSharedMemorySize(); | 64 static size_t MaxSharedMemorySize(); |
64 #endif | 65 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
65 | 66 |
66 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
67 // Returns the name of the version entry we wish to look up in the | 68 // Returns the name of the version entry we wish to look up in the |
68 // Linux Standard Base release information file. | 69 // Linux Standard Base release information file. |
69 static std::string GetLinuxStandardBaseVersionKey(); | 70 static std::string GetLinuxStandardBaseVersionKey(); |
70 | 71 |
71 // Parses /etc/lsb-release to get version information for Google Chrome OS. | 72 // Parses /etc/lsb-release to get version information for Google Chrome OS. |
72 // Declared here so it can be exposed for unit testing. | 73 // Declared here so it can be exposed for unit testing. |
73 static void ParseLsbRelease(const std::string& lsb_release, | 74 static void ParseLsbRelease(const std::string& lsb_release, |
74 int32* major_version, | 75 int32* major_version, |
75 int32* minor_version, | 76 int32* minor_version, |
76 int32* bugfix_version); | 77 int32* bugfix_version); |
77 #endif | 78 |
| 79 // Retrieves the approximate time at which Chrome OS was last updated. Each |
| 80 // time a new build is created, /etc/lsb-release is modified with the new |
| 81 // version numbers of the release. This function reads that file's metadata |
| 82 // and sets |time| equal to the time at which it was last modified, a close |
| 83 // approximation to the time the last Chrome OS update occurred. On success, |
| 84 // this function returns |true|, and if a problem is encountered, it returns |
| 85 // |false|. |
| 86 static bool GetTimeLastUpdated(base::Time* time); |
| 87 #endif // defined(OS_CHROMEOS) |
78 }; | 88 }; |
79 | 89 |
80 } // namespace base | 90 } // namespace base |
81 | 91 |
82 #endif // BASE_SYS_INFO_H_ | 92 #endif // BASE_SYS_INFO_H_ |
OLD | NEW |