summaryrefslogtreecommitdiffstats
path: root/base/sys_info_mac.cc
diff options
context:
space:
mode:
authorhongbo.min@intel.com <hongbo.min@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-08 09:53:01 +0000
committerhongbo.min@intel.com <hongbo.min@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-08 09:53:01 +0000
commitd5df0c8c043a25aa7b7d43f7f6f29198bcf74348 (patch)
treed937d7dc6866099dfc624cbc624020449f792559 /base/sys_info_mac.cc
parent4c35f73337302284aaa503dc2d6b2172623687b5 (diff)
downloadchromium_src-d5df0c8c043a25aa7b7d43f7f6f29198bcf74348.zip
chromium_src-d5df0c8c043a25aa7b7d43f7f6f29198bcf74348.tar.gz
chromium_src-d5df0c8c043a25aa7b7d43f7f6f29198bcf74348.tar.bz2
Refine systemInfo.cpu API and provide systemInfo.cpu.get impl for Windows and Linux.
BUG=136519 TEST=browser_test --gtest_filter=SystemInfoCpuApiTest.* Review URL: https://chromiumcodereview.appspot.com/10914060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info_mac.cc')
-rw-r--r--base/sys_info_mac.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/sys_info_mac.cc b/base/sys_info_mac.cc
index 1a1d23c..3a93689 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