Chromium Code Reviews| 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); |
| } |