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

Unified Diff: content/renderer/manifest/manifest_parser.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
« no previous file with comments | « content/renderer/manifest/manifest_manager.cc ('k') | content/renderer/manifest/manifest_uma_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_parser.cc
diff --git a/content/renderer/manifest/manifest_parser.cc b/content/renderer/manifest/manifest_parser.cc
index a68ca2ae72e3fb14b86582ebae006612bfd7d201..bab85cd75f1b1acc9aad4161f213dfe65b155f6e 100644
--- a/content/renderer/manifest/manifest_parser.cc
+++ b/content/renderer/manifest/manifest_parser.cc
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "content/public/common/manifest.h"
+#include "content/renderer/manifest/manifest_uma_util.h"
#include "ui/gfx/geometry/size.h"
namespace content {
@@ -291,11 +292,13 @@ Manifest ManifestParser::Parse(const base::StringPiece& json,
if (!value) {
// TODO(mlamouri): get the JSON parsing error and report it to the developer
// console.
+ ManifestUmaUtil::ParseFailed();
return Manifest();
}
if (value->GetType() != base::Value::TYPE_DICTIONARY) {
// TODO(mlamouri): provide a custom message to the developer console.
+ ManifestUmaUtil::ParseFailed();
return Manifest();
}
@@ -303,6 +306,7 @@ Manifest ManifestParser::Parse(const base::StringPiece& json,
value->GetAsDictionary(&dictionary);
if (!dictionary) {
// TODO(mlamouri): provide a custom message to the developer console.
+ ManifestUmaUtil::ParseFailed();
return Manifest();
}
@@ -316,6 +320,8 @@ Manifest ManifestParser::Parse(const base::StringPiece& json,
manifest.icons = ParseIcons(*dictionary, manifest_url);
manifest.gcm_sender_id = ParseGCMSenderID(*dictionary);
+ ManifestUmaUtil::ParseSucceeded(manifest);
+
return manifest;
}
« no previous file with comments | « content/renderer/manifest/manifest_manager.cc ('k') | content/renderer/manifest/manifest_uma_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698