Chromium Code Reviews| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 99 |
| 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",...). |
|
Thiemo Nagel
2016/11/09 20:48:46
Please improve the docs of this method as well so
| |
| 110 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. | 110 // Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. |
| 111 static std::string GetLsbReleaseBoard(); | 111 static std::string GetLsbReleaseBoard(); |
| 112 | 112 |
| 113 // Convenience function for GetLsbReleaseBoard() removing "-signed.." if | |
| 114 // present. Returns "unknown" if CHROMEOS_RELEASE_BOARD is not set. | |
| 115 static std::string GetStrippedReleaseBoard(); | |
| 116 | |
| 113 // Returns the creation time of /etc/lsb-release. (Used to get the date and | 117 // Returns the creation time of /etc/lsb-release. (Used to get the date and |
| 114 // time of the Chrome OS build). | 118 // time of the Chrome OS build). |
| 115 static Time GetLsbReleaseTime(); | 119 static Time GetLsbReleaseTime(); |
| 116 | 120 |
| 117 // Returns true when actually running in a Chrome OS environment. | 121 // Returns true when actually running in a Chrome OS environment. |
| 118 static bool IsRunningOnChromeOS(); | 122 static bool IsRunningOnChromeOS(); |
| 119 | 123 |
| 120 // Test method to force re-parsing of lsb-release. | 124 // Test method to force re-parsing of lsb-release. |
| 121 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, | 125 static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, |
| 122 const Time& lsb_release_time); | 126 const Time& lsb_release_time); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 135 | 139 |
| 136 // Returns true if this is a low-end device. | 140 // Returns true if this is a low-end device. |
| 137 // Low-end device refers to devices having less than 512M memory in the | 141 // Low-end device refers to devices having less than 512M memory in the |
| 138 // current implementation. | 142 // current implementation. |
| 139 static bool IsLowEndDevice(); | 143 static bool IsLowEndDevice(); |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 } // namespace base | 146 } // namespace base |
| 143 | 147 |
| 144 #endif // BASE_SYS_INFO_H_ | 148 #endif // BASE_SYS_INFO_H_ |
| OLD | NEW |