summaryrefslogtreecommitdiffstats
path: root/base/sys_info_win.cc
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 10:09:39 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-17 10:09:39 +0000
commit2a758d61d9ee5c8ae43bf5a6d974d27cc6779ef2 (patch)
tree7cb3e04c299f96ab01d0848c47fbb0d0aedf7e97 /base/sys_info_win.cc
parentc1444fef13763a4f19215bdffb148f4d1a6c6098 (diff)
downloadchromium_src-2a758d61d9ee5c8ae43bf5a6d974d27cc6779ef2.zip
chromium_src-2a758d61d9ee5c8ae43bf5a6d974d27cc6779ef2.tar.gz
chromium_src-2a758d61d9ee5c8ae43bf5a6d974d27cc6779ef2.tar.bz2
Add a class for extracting system-specific information, like the number of processors.
Review URL: http://codereview.chromium.org/3084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info_win.cc')
-rw-r--r--base/sys_info_win.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
new file mode 100644
index 0000000..4d32489
--- /dev/null
+++ b/base/sys_info_win.cc
@@ -0,0 +1,18 @@
+// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/sys_info.h"
+
+#include <windows.h>
+
+namespace base {
+
+// static
+int SysInfo::NumberOfProcessors() {
+ SYSTEM_INFO info;
+ GetSystemInfo(&info);
+ return static_cast<int>(info.dwNumberOfProcessors);
+}
+
+} // namespace base