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

Unified Diff: base/sys_info_mac.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/sys_info_linux.cc ('k') | base/sys_info_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_mac.cc
diff --git a/base/sys_info_mac.cc b/base/sys_info_mac.cc
index 1a1d23c236f6856ebb55157a0dcd56706ca4d6ef..3a936890342b94d37ddccdad1d5f19ecfe28785a 100644
--- a/base/sys_info_mac.cc
+++ b/base/sys_info_mac.cc
@@ -8,6 +8,8 @@
#include <CoreServices/CoreServices.h>
#include <mach/mach_host.h>
#include <mach/mach_init.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
#include "base/logging.h"
#include "base/stringprintf.h"
@@ -54,4 +56,13 @@ int64 SysInfo::AmountOfPhysicalMemory() {
return static_cast<int64>(hostinfo.max_mem);
}
+// static
+std::string SysInfo::CPUModelName() {
+ char name[256];
+ size_t len = arraysize(name);
+ if (sysctlbyname("machdep.cpu.brand_string", &name, &len, NULL, 0) == 0)
+ return name;
+ return std::string();
+}
+
} // namespace base
« no previous file with comments | « base/sys_info_linux.cc ('k') | base/sys_info_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698