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

Side by Side Diff: base/sys_info_win.cc

Issue 10910247: Implement SysInfo::CPUArchitecture() on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, fix win build 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_posix.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <windows.h> 7 #include <windows.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 return version; 69 return version;
70 } 70 }
71 71
72 // TODO: Implement OperatingSystemVersionComplete, which would include 72 // TODO: Implement OperatingSystemVersionComplete, which would include
73 // patchlevel/service pack number. 73 // patchlevel/service pack number.
74 // See chrome/browser/feedback/feedback_util.h, FeedbackUtil::SetOSVersion. 74 // See chrome/browser/feedback/feedback_util.h, FeedbackUtil::SetOSVersion.
75 75
76 // static 76 // static
77 std::string SysInfo::CPUArchitecture() { 77 std::string SysInfo::CPUArchitecture() {
78 // TODO: Make this vary when we support any other architectures. 78 win::OSInfo::WindowsArchitecture arch =
79 return "x86"; 79 win::OSInfo::GetInstance()->architecture();
80 switch (arch) {
81 case win::OSInfo::X86_ARCHITECTURE:
82 return "x86";
83 case win::OSInfo::X64_ARCHITECTURE:
84 return "x86_64";
85 case win::OSInfo::IA64_ARCHITECTURE:
86 return "ia64";
87 default:
88 return "";
89 }
80 } 90 }
81 91
82 // static 92 // static
83 std::string SysInfo::CPUModelName() { 93 std::string SysInfo::CPUModelName() {
84 return win::OSInfo::GetInstance()->processor_model_name(); 94 return win::OSInfo::GetInstance()->processor_model_name();
85 } 95 }
86 96
87 // static 97 // static
88 size_t SysInfo::VMAllocationGranularity() { 98 size_t SysInfo::VMAllocationGranularity() {
89 return win::OSInfo::GetInstance()->allocation_granularity(); 99 return win::OSInfo::GetInstance()->allocation_granularity();
90 } 100 }
91 101
92 // static 102 // static
93 void SysInfo::OperatingSystemVersionNumbers(int32* major_version, 103 void SysInfo::OperatingSystemVersionNumbers(int32* major_version,
94 int32* minor_version, 104 int32* minor_version,
95 int32* bugfix_version) { 105 int32* bugfix_version) {
96 win::OSInfo* os_info = win::OSInfo::GetInstance(); 106 win::OSInfo* os_info = win::OSInfo::GetInstance();
97 *major_version = os_info->version_number().major; 107 *major_version = os_info->version_number().major;
98 *minor_version = os_info->version_number().minor; 108 *minor_version = os_info->version_number().minor;
99 *bugfix_version = 0; 109 *bugfix_version = 0;
100 } 110 }
101 111
102 } // namespace base 112 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698