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

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: 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..f73d6f27aa3a9a8ccd8362cb11143c61c9f93791 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))
Mark Mentovai 2014/11/04 14:36:37 The ! makes things look like failure. Can you use
jeremy 2014/11/05 05:38:06 Done.
+ return std::string(model, 0, len);
+ return "Unknown";
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698