Chromium Code Reviews| Index: base/sys_info_ios.mm |
| diff --git a/base/sys_info_ios.mm b/base/sys_info_ios.mm |
| index 48c7bd944841b1f215e44c0cff71a02c1dff54c4..4906f912378b18abf1a35af70ad1f58976e5cd30 100644 |
| --- a/base/sys_info_ios.mm |
| +++ b/base/sys_info_ios.mm |
| @@ -6,6 +6,8 @@ |
| #import <UIKit/UIKit.h> |
| #include <mach/mach.h> |
| +#include <sys/sysctl.h> |
| +#include <sys/types.h> |
| #include "base/logging.h" |
| #include "base/mac/scoped_nsautorelease_pool.h" |
| @@ -65,4 +67,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 ""; |
|
Mark Mentovai
2012/09/06 14:45:18
Rather than an implicit conversion, use std::strin
Hongbo Min
2012/09/06 14:55:16
Done.
|
| +} |
| + |
| } // namespace base |