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

Unified Diff: base/sys_info_mac.cc

Issue 699173002: UMA: Set Hardware model class on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile on ios Created 6 years, 1 month 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.cc ('k') | base/sys_info_unittest.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 57e1f835e32967778f27e7c143455640323f3b5c..18df62482ea119db2d865f1745cf9de271767a19 100644
--- a/base/sys_info_mac.cc
+++ b/base/sys_info_mac.cc
@@ -85,4 +85,12 @@ std::string SysInfo::CPUModelName() {
return std::string();
}
+std::string SysInfo::HardwareModelName() {
+ char model[256];
+ size_t len = sizeof(model);
+ if (sysctlbyname("hw.model", model, &len, NULL, 0) == 0)
+ return std::string(model, 0, len);
+ return std::string();
+}
+
} // namespace base
« no previous file with comments | « base/sys_info.cc ('k') | base/sys_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698