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

Unified Diff: base/win/windows_version.cc

Issue 10914060: Refine systemInfo.cpu API defintions and provide systemInfo.cpu.get impl for Windows and Linux (Closed) Base URL: svn://svn.chromium.org/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win/windows_version.h ('k') | chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/windows_version.cc
diff --git a/base/win/windows_version.cc b/base/win/windows_version.cc
index f0c94e2905aa74ac6d6f17cb187701dc1df817fa..c130e0e397d7654a62af60cf0aed989e93d89edf 100644
--- a/base/win/windows_version.cc
+++ b/base/win/windows_version.cc
@@ -7,6 +7,8 @@
#include <windows.h>
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
namespace base {
namespace win {
@@ -76,6 +78,18 @@ OSInfo::OSInfo()
OSInfo::~OSInfo() {
}
+std::string OSInfo::processor_model_name() {
+ if (processor_model_name_.empty()) {
+ const wchar_t kProcessorNameString[] =
+ L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";
+ base::win::RegKey key(HKEY_LOCAL_MACHINE, kProcessorNameString, KEY_READ);
+ string16 value;
+ key.ReadValue(L"ProcessorNameString", &value);
+ processor_model_name_ = UTF16ToUTF8(value);
+ }
+ return processor_model_name_;
+}
+
// static
OSInfo::WOW64Status OSInfo::GetWOW64StatusForProcess(HANDLE process_handle) {
typedef BOOL (WINAPI* IsWow64ProcessFunc)(HANDLE, PBOOL);
« no previous file with comments | « base/win/windows_version.h ('k') | chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698