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

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

Issue 1624853005: SafeBrowsing UMA: Adds an inconsistent threat type histogram bucket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/protocol_manager.cc
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index cc5984187bf35b948ad0686cbdeaebfaad1c3ba7..c0ce31ee83f26623a276e2f2a29c4d82938c3e76 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -90,13 +90,17 @@ enum ParseResultType {
// A match in the response had an unexpected PLATFORM_TYPE.
UNEXPECTED_PLATFORM_TYPE_ERROR = 3,
- // A match in teh response contained no metadata where metadata was
+ // A match in the response contained no metadata where metadata was
// expected.
NO_METADATA_ERROR = 4,
+ // A match in the response contained a ThreatType that was inconsistent
+ // with the other matches.
+ INCONSISTENT_THREAT_TYPE_ERROR = 5,
+
// Memory space for histograms is determined by the max. ALWAYS
// ADD NEW VALUES BEFORE THIS ONE.
- PARSE_GET_HASH_RESULT_MAX = 5
+ PARSE_GET_HASH_RESULT_MAX = 6
};
// Record parsing errors of a GetHash result.
@@ -375,14 +379,14 @@ bool SafeBrowsingProtocolManager::ParseV4HashResponse(
}
if (!match.has_threat_type()) {
- // TODO(kcarattini): Add UMA.
+ RecordParseGetHashResult(UNEXPECTED_THREAT_TYPE_ERROR);
return false;
}
if (expected_threat_type == THREAT_TYPE_UNSPECIFIED) {
expected_threat_type = match.threat_type();
} else if (match.threat_type() != expected_threat_type) {
- // TODO(kcarattini): Add UMA.
+ RecordParseGetHashResult(INCONSISTENT_THREAT_TYPE_ERROR);
return false;
}
@@ -397,7 +401,7 @@ bool SafeBrowsingProtocolManager::ParseV4HashResponse(
}
// Different threat types will handle the metadata differently.
- if (match.has_threat_type() && match.threat_type() == API_ABUSE) {
+ if (match.threat_type() == API_ABUSE) {
if (match.has_platform_type() &&
match.platform_type() == CHROME_PLATFORM) {
if (match.has_threat_entry_metadata()) {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698