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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
101 typedef std::map<std::string, std::string> LsbReleaseMap; | 101 typedef std::map<std::string, std::string> LsbReleaseMap; |
102 | 102 |
103 // Returns the contents of /etc/lsb-release as a map. | 103 // Returns the contents of /etc/lsb-release as a map. |
104 static const LsbReleaseMap& GetLsbReleaseMap(); | 104 static const LsbReleaseMap& GetLsbReleaseMap(); |
105 | 105 |
106 // If |key| is present in the LsbReleaseMap, sets |value| and returns true. | 106 // If |key| is present in the LsbReleaseMap, sets |value| and returns true. |
107 static bool GetLsbReleaseValue(const std::string& key, std::string* value); | 107 static bool GetLsbReleaseValue(const std::string& key, std::string* value); |
108 | 108 |
109 // Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...). | 109 // Convenience function for GetLsbReleaseValue("CHROMEOS_RELEASE_BOARD",...). |
110 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. | 110 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. Otherwise returns |
111 // the full name of the board. WARNING: the returned value often differs in | |
112 // locally built system compared to chromebooks that use the official version. | |
Thiemo Nagel
2016/11/23 20:21:19
Nit: "locally built" --> developer built
Nit: "chr
igorcov
2016/11/25 11:08:59
Done.
| |
113 // E.g. for locally built version, the function could return 'glimmer' while | |
114 // for officially used versions it would be like 'glimmer-signed-mp-v4keys'. | |
115 // Use GetStrippedReleaseBoard() function if you need only the short name of | |
116 // the board (would be 'glimmer' in the case described above). | |
111 static std::string GetLsbReleaseBoard(); | 117 static std::string GetLsbReleaseBoard(); |
112 | 118 |
119 // Convenience function for GetLsbReleaseBoard() removing "-signed.." if | |
Thiemo Nagel
2016/11/23 20:21:19
Nit: removing "-signed.." --> removing trailing "-
igorcov
2016/11/25 11:08:59
Done.
| |
120 // present. Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. | |
121 static std::string GetStrippedReleaseBoard(); | |
122 | |
113 // Returns the creation time of /etc/lsb-release. (Used to get the date and | 123 // Returns the creation time of /etc/lsb-release. (Used to get the date and |
114 // time of the Chrome OS build). | 124 // time of the Chrome OS build). |
115 static Time GetLsbReleaseTime(); | 125 static Time GetLsbReleaseTime(); |
116 | 126 |
117 // Returns true when actually running in a Chrome OS environment. | 127 // Returns true when actually running in a Chrome OS environment. |
118 static bool IsRunningOnChromeOS(); | 128 static bool IsRunningOnChromeOS(); |
119 | 129 |
120 // Test method to force re-parsing of lsb-release. | 130 // Test method to force re-parsing of lsb-release. |
121 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, | 131 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, |
122 const Time& lsb_release_time); | 132 const Time& lsb_release_time); |
(...skipping 12 matching lines...) Expand all Loading... | |
135 | 145 |
136 // Returns true if this is a low-end device. | 146 // Returns true if this is a low-end device. |
137 // Low-end device refers to devices having less than 512M memory in the | 147 // Low-end device refers to devices having less than 512M memory in the |
138 // current implementation. | 148 // current implementation. |
139 static bool IsLowEndDevice(); | 149 static bool IsLowEndDevice(); |
140 }; | 150 }; |
141 | 151 |
142 } // namespace base | 152 } // namespace base |
143 | 153 |
144 #endif // BASE_SYS_INFO_H_ | 154 #endif // BASE_SYS_INFO_H_ |
OLD | NEW |