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

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..58a0aefee6212e0647476370f10e5fd0d04d30af 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -61,15 +61,19 @@ size_t SysInfo::MaxSharedMemorySize() {
// static
std::string SysInfo::CPUModelName() {
- const char kModelNamePrefix[] = "model name";
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ const char kCpuModelPrefix[] = "Hardware";
+#else
+ const char kCpuModelPrefix[] = "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)){
- if (line.compare(0, strlen(kModelNamePrefix), kModelNamePrefix) == 0) {
+ while (std::getline(iss, line)) {
+ if (line.compare(0, strlen(kCpuModelPrefix), kCpuModelPrefix) == 0) {
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