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

Side by Side Diff: base/sys_info_posix.cc

Issue 11140015: Cleanup: Rename to base::SysInfo::CPUArchitecture() to OperatingSystemArchitecture(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sys_info.h ('k') | base/sys_info_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 #include <sys/utsname.h> 10 #include <sys/utsname.h>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 struct utsname info; 68 struct utsname info;
69 if (uname(&info) < 0) { 69 if (uname(&info) < 0) {
70 NOTREACHED(); 70 NOTREACHED();
71 return ""; 71 return "";
72 } 72 }
73 return std::string(info.release); 73 return std::string(info.release);
74 } 74 }
75 #endif 75 #endif
76 76
77 // static 77 // static
78 std::string SysInfo::CPUArchitecture() { 78 std::string SysInfo::OperatingSystemArchitecture() {
79 struct utsname info; 79 struct utsname info;
80 if (uname(&info) < 0) { 80 if (uname(&info) < 0) {
81 NOTREACHED(); 81 NOTREACHED();
82 return ""; 82 return "";
83 } 83 }
84 std::string arch(info.machine); 84 std::string arch(info.machine);
85 if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") { 85 if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") {
86 arch = "x86"; 86 arch = "x86";
87 } else if (arch == "amd64") { 87 } else if (arch == "amd64") {
88 arch = "x86_64"; 88 arch = "x86_64";
89 } 89 }
90 return arch; 90 return arch;
91 } 91 }
92 92
93 // static 93 // static
94 size_t SysInfo::VMAllocationGranularity() { 94 size_t SysInfo::VMAllocationGranularity() {
95 return getpagesize(); 95 return getpagesize();
96 } 96 }
97 97
98 } // namespace base 98 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info.h ('k') | base/sys_info_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698