Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: base/sys_info.h

Issue 2489853002: Added function to provide the short board name of the device (Closed)
Patch Set: Nit Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/lock_state_controller.cc ('k') | base/sys_info_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // developer built system compared to devices that use the official version.
113 // E.g. for developer 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 trailing "-signed-*"
120 // if 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
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_
OLDNEW
« no previous file with comments | « ash/wm/lock_state_controller.cc ('k') | base/sys_info_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698