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

Unified Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 2068843002: [Tracing] Set os-name to CrOS in trace metadata, and get the correct version for it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 3 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_controller_impl.cc
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 0bd18de106a8dd1f59c37b3d6af09c32487537ac..2eaab7a417ac6141c809f7a81b7fc78f2a0d646d 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -837,9 +837,23 @@ TracingControllerImpl::GenerateTracingMetadataDict() const {
metadata_dict->SetString("user-agent", GetContentClient()->GetUserAgent());
// OS
+#if defined(OS_CHROMEOS)
+ metadata_dict->SetString("os-name", "CrOS");
+ int32_t major_version;
+ int32_t minor_version;
+ int32_t bugfix_version;
+ // OperatingSystemVersion only has a POSIX implementation which returns the
+ // wrong versions for CrOS.
+ base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version,
+ &bugfix_version);
+ metadata_dict->SetString(
+ "os-version", base::StringPrintf("%d.%d.%d", major_version, minor_version,
+ bugfix_version));
+#else
metadata_dict->SetString("os-name", base::SysInfo::OperatingSystemName());
metadata_dict->SetString("os-version",
base::SysInfo::OperatingSystemVersion());
+#endif
metadata_dict->SetString("os-arch",
base::SysInfo::OperatingSystemArchitecture());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698