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

Unified Diff: content/renderer/manifest/manifest_uma_util.cc

Issue 622813002: [Manifest] Add metrics recording. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen_orientation_usage_count
Patch Set: Created 6 years, 2 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: content/renderer/manifest/manifest_uma_util.cc
diff --git a/content/renderer/manifest/manifest_uma_util.cc b/content/renderer/manifest/manifest_uma_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9d6b9a21d940b8dc9c1820a32c57e02560b1029f
--- /dev/null
+++ b/content/renderer/manifest/manifest_uma_util.cc
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/manifest/manifest_uma_util.h"
+
+#include "base/metrics/histogram.h"
+#include "content/public/common/manifest.h"
+
+namespace content {
+
+void ManifestUmaUtil::ParsedManifest(const Manifest& manifest) {
+ UMA_HISTOGRAM_BOOLEAN("Manifest.IsEmpty", manifest.IsEmpty());
Miguel Garcia 2014/10/02 14:26:46 you could early return here if it's empty.
mlamouri (slow - plz ping) 2014/10/02 15:35:06 Done.
+ UMA_HISTOGRAM_BOOLEAN("Manifest.name", !manifest.name.is_null());
+ UMA_HISTOGRAM_BOOLEAN("Manifest.short_name", !manifest.short_name.is_null());
+ UMA_HISTOGRAM_BOOLEAN("Manifest.start_url", !manifest.start_url.is_empty());
+ UMA_HISTOGRAM_BOOLEAN("Manifest.display",
+ manifest.display != Manifest::DISPLAY_MODE_UNSPECIFIED);
+ UMA_HISTOGRAM_BOOLEAN("Manifest.orientation",
+ manifest.orientation != blink::WebScreenOrientationLockDefault);
+ UMA_HISTOGRAM_BOOLEAN("Manifest.icons", !manifest.icons.empty());
+ UMA_HISTOGRAM_BOOLEAN("Manifest.gcm_sender_id",
+ !manifest.gcm_sender_id.is_null());
Miguel Garcia 2014/10/02 14:26:46 what if it's empty?
mlamouri (slow - plz ping) 2014/10/02 15:35:06 It will be null if the value was not present of fa
+}
+
+void ManifestUmaUtil::FetchSucceeded() {
+ UMA_HISTOGRAM_BOOLEAN("Manifest.FetchSuccess", true);
+}
+
+void ManifestUmaUtil::FetchFailed() {
+ UMA_HISTOGRAM_BOOLEAN("Manifest.FetchSuccess", false);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698