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

Unified Diff: chrome/browser/metrics/metrics_log.cc

Issue 11014006: Add Android fingerprint to metrics logs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
Index: chrome/browser/metrics/metrics_log.cc
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 8025882c45940c551c5167d4ec958d705e3ed940..27e197fcb553cfb7c0b431213fca904106e06abf 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -45,6 +45,10 @@
#include "ui/gfx/screen.h"
#include "webkit/plugins/webplugininfo.h"
+#if defined(OS_ANDROID)
+#include "base/android/build_info.h"
+#endif
+
#define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name)
#if defined(OS_WIN)
@@ -325,8 +329,10 @@ void MetricsLog::RecordIncrementalStabilityElements(
OPEN_ELEMENT_FOR_SCOPE("profile");
WriteCommonEventAttributes();
-
WriteInstallElement();
+#if defined(OS_ANDROID)
+ WriteOSInfoElement();
+#endif
Ilya Sherman 2012/10/01 23:01:38 I don't think it's appropriate to add the OS info
gone 2012/10/02 18:24:24 With nilesh's comment as context, does your commen
Ilya Sherman 2012/10/02 21:37:45 TL;DR: You can ignore my previous comment w.r.t. t
gone 2012/10/02 23:10:00 If that's the case then we really shouldn't be for
{
OPEN_ELEMENT_FOR_SCOPE("stability"); // Minimal set of stability elements.
@@ -648,7 +654,6 @@ void MetricsLog::RecordEnvironment(
OPEN_ELEMENT_FOR_SCOPE("profile");
WriteCommonEventAttributes();
-
WriteInstallElement();
// Write the XML version.
@@ -675,13 +680,7 @@ void MetricsLog::RecordEnvironment(
#endif
}
- {
- // Write the XML version.
- // We'll write the protobuf version in RecordEnvironmentProto().
- OPEN_ELEMENT_FOR_SCOPE("os");
- WriteAttribute("name", base::SysInfo::OperatingSystemName());
- WriteAttribute("version", base::SysInfo::OperatingSystemVersion());
- }
+ WriteOSInfoElement();
{
OPEN_ELEMENT_FOR_SCOPE("gpu");
@@ -776,6 +775,10 @@ void MetricsLog::RecordEnvironmentProto(
#endif
os->set_name(os_name);
os->set_version(base::SysInfo::OperatingSystemVersion());
+#if defined(OS_ANDROID)
+ os->set_fingerprint(
+ base::android::BuildInfo::GetInstance()->android_build_fp());
+#endif
const content::GPUInfo& gpu_info =
GpuDataManager::GetInstance()->GetGPUInfo();
@@ -894,6 +897,17 @@ void MetricsLog::WriteProfileMetrics(const std::string& profileidhash,
}
}
+void MetricsLog::WriteOSInfoElement() {
+ // Write the XML version.
Ilya Sherman 2012/10/01 23:01:38 As I mentioned above, I don't think you should mov
gone 2012/10/02 23:45:10 Undid the change. We'll go with the protobuf on m
+ OPEN_ELEMENT_FOR_SCOPE("os");
+ WriteAttribute("name", base::SysInfo::OperatingSystemName());
+ WriteAttribute("version", base::SysInfo::OperatingSystemVersion());
+#if defined(OS_ANDROID)
+ WriteAttribute("fingerprint",
+ base::android::BuildInfo::GetInstance()->android_build_fp());
Ilya Sherman 2012/10/01 23:01:38 I don't recommend trying to add this field to the
gone 2012/10/02 23:45:10 Removed.
+#endif
+}
+
void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
DCHECK(!locked());

Powered by Google App Engine
This is Rietveld 408576698