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

Side by Side Diff: base/sys_info_posix.cc

Issue 10910247: Implement SysInfo::CPUArchitecture() on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 #endif 73 #endif
74 74
75 // static 75 // static
76 std::string SysInfo::CPUArchitecture() { 76 std::string SysInfo::CPUArchitecture() {
77 struct utsname info; 77 struct utsname info;
78 if (uname(&info) < 0) { 78 if (uname(&info) < 0) {
79 NOTREACHED(); 79 NOTREACHED();
80 return ""; 80 return "";
81 } 81 }
82 return std::string(info.machine); 82 std::string arch(info.machine);
83 if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") {
84 arch = "x86";
85 } else if (arch == "amd64") {
86 arch = "x86_64";
Mark Mentovai 2012/09/13 12:40:19 For Mac and Linux x86_*, this returns the kernel’s
Lei Zhang 2012/09/21 21:10:21 Right, I think CPUArchitecture() should be renamed
87 }
88 return arch;
83 } 89 }
84 90
85 // static 91 // static
86 size_t SysInfo::VMAllocationGranularity() { 92 size_t SysInfo::VMAllocationGranularity() {
87 return getpagesize(); 93 return getpagesize();
88 } 94 }
89 95
90 } // namespace base 96 } // 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