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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.h

Issue 1579083002: Add UMA metric for GetHash parsing errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@osb-pm-2
Patch Set: Rebase Created 4 years, 11 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/safe_browsing/protocol_manager.h
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index 8d3c1191ee31cca201514be8e1954a173377c1c3..e595b1414dffef71719ff06ba54eb2ab6afc80f8 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -179,6 +179,33 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// Record a V4 GetHash result.
static void RecordGetV4HashResult(ResultType result_type);
+ // Enumerate V4 parsing failures for histogramming purposes. DO NOT CHANGE
Nathan Parker 2016/01/15 19:34:43 This could all go in a n anonymous namespace in th
kcarattini 2016/01/20 04:02:05 Done.
+ // THE ORDERING OF THESE VALUES.
+ enum ParseResultType {
+ // Error parsing the protocol buffer from a string.
+ PARSE_FROM_STRING_ERROR,
Nathan Parker 2016/01/15 19:34:42 I like to add "= 1.." to each so that you can more
kcarattini 2016/01/20 04:02:05 Done.
+
+ // A match in the response had an unexpected THREAT_ENTRY_TYPE.
+ UNEXPECTED_THREAT_ENTRY_TYPE_ERROR,
+
+ // A match in the response had an unexpected THREAT_TYPE.
+ UNEXPECTED_THREAT_TYPE_ERROR,
+
+ // A match in the response had an unexpected PLATFORM_TYPE.
+ UNEXPECTED_PLATFORM_TYPE_ERROR,
+
+ // A match in teh response contained no metadata where metadata was
+ // expected.
+ NO_METADATA_ERROR,
+
+ // Memory space for histograms is determined by the max. ALWAYS
+ // ADD NEW VALUES BEFORE THIS ONE.
+ PARSE_GET_HASH_RESULT_MAX
+ };
+
+ // Record parsing errors of a GetHash result.
+ static void RecordParseGetHashResult(ParseResultType result_type);
+
// Record HTTP response code when there's no error in fetching an HTTP
// request, and the error code, when there is.
// |metric_name| is the name of the UMA metric to record the response code or
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | chrome/browser/safe_browsing/protocol_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698