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

Unified Diff: base/sys_info_linux.cc

Issue 14872004: Fixed CPU info reporting on ChromeOS ARM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index 7e623395571431e5029af8b17181c8774c1bcbc4..5ebbeea20fee4a82efc54417bfab9d9069b39a2c 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -61,15 +61,23 @@ size_t SysInfo::MaxSharedMemorySize() {
// static
std::string SysInfo::CPUModelName() {
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ const char kHardwarePrefix[] = "Hardware";
+#else
const char kModelNamePrefix[] = "model name";
+#endif
std::string contents;
file_util::ReadFileToString(FilePath("/proc/cpuinfo"), &contents);
DCHECK(!contents.empty());
if (!contents.empty()) {
std::istringstream iss(contents);
std::string line;
- while (std::getline(iss, line)){
+ while (std::getline(iss, line)) {
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
darin (slow to review) 2013/05/03 06:07:09 nit: #ifdefs suck. i'd be tempted to generalize t
zel 2013/05/03 18:02:16 Down to one #ifdef now. Even if I split this in a
+ if (line.compare(0, strlen(kHardwarePrefix), kHardwarePrefix) == 0) {
+#else
if (line.compare(0, strlen(kModelNamePrefix), kModelNamePrefix) == 0) {
+#endif
size_t pos = line.find(": ");
return line.substr(pos + 2);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698