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

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 review comments 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
Index: base/sys_info_mac.cc
diff --git a/base/sys_info_mac.cc b/base/sys_info_mac.cc
index 57e1f835e32967778f27e7c143455640323f3b5c..b3c7ba7c1adabb9ab4f269f84069c47905a05937 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 "";
Alexei Svitkine (slow) 2014/11/05 15:47:21 Nit: std::string()
+}
+
} // namespace base
« base/sys_info.cc ('K') | « 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