summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 12:12:35 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 12:12:35 +0000
commita24364570877ef740253580e48a19550d277f4fe (patch)
tree5817828bb6365253ca40a13a4eea7e301827ec09 /chrome/browser/safe_browsing
parentb7ee72072288d79a67a9c2c8df74bc314ada8b85 (diff)
downloadchromium_src-a24364570877ef740253580e48a19550d277f4fe.zip
chromium_src-a24364570877ef740253580e48a19550d277f4fe.tar.gz
chromium_src-a24364570877ef740253580e48a19550d277f4fe.tar.bz2
Safebrowsing: Add histogram values for gethash parse error and network errors.
BUG=360232 Review URL: https://codereview.chromium.org/227613008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc7
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.h15
2 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 6c13779..5417835 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -171,6 +171,7 @@ void SafeBrowsingProtocolManager::GetFullHash(
// allowed time. If we are, we can proceed with the request. If not, we are
// required to return empty results (i.e. treat the page as safe).
if (gethash_error_count_ && Time::Now() <= next_gethash_time_) {
+ RecordGetHashResult(is_download, GET_HASH_BACKOFF_ERROR);
std::vector<SBFullHashResult> full_hashes;
callback.Run(full_hashes, false);
return;
@@ -240,14 +241,18 @@ void SafeBrowsingProtocolManager::OnURLFetchComplete(
&full_hashes);
if (!parsed_ok) {
full_hashes.clear();
- // TODO(cbentzel): Should can_cache be set to false here?
+ RecordGetHashResult(details.is_download, GET_HASH_PARSE_ERROR);
+ // TODO(cbentzel): Should can_cache be set to false here? (See
+ // http://crbug.com/360232.)
}
} else {
HandleGetHashError(Time::Now());
if (source->GetStatus().status() == net::URLRequestStatus::FAILED) {
+ RecordGetHashResult(details.is_download, GET_HASH_NETWORK_ERROR);
VLOG(1) << "SafeBrowsing GetHash request for: " << source->GetURL()
<< " failed with error: " << source->GetStatus().error();
} else {
+ RecordGetHashResult(details.is_download, GET_HASH_HTTP_ERROR);
VLOG(1) << "SafeBrowsing GetHash request for: " << source->GetURL()
<< " failed with error: " << source->GetResponseCode();
}
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index f5555e3..d53fbea 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -129,8 +129,7 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
GET_HASH_STATUS_204,
// Subset of successful responses which returned no full hashes.
- // This includes the 204 case, and also 200 responses for stale
- // prefixes (deleted at the server but yet deleted on the client).
+ // This includes the STATUS_204 case, and the *_ERROR cases.
GET_HASH_FULL_HASH_EMPTY,
// Subset of successful responses for which one or more of the
@@ -142,6 +141,18 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// cleared up by the full hashes.
GET_HASH_FULL_HASH_MISS,
+ // Subset of successful responses where the response body wasn't parsable.
+ GET_HASH_PARSE_ERROR,
+
+ // Gethash request failed (network error).
+ GET_HASH_NETWORK_ERROR,
+
+ // Gethash request returned HTTP result code other than 200 or 204.
+ GET_HASH_HTTP_ERROR,
+
+ // Gethash attempted during error backoff, no request sent.
+ GET_HASH_BACKOFF_ERROR,
+
// Memory space for histograms is determined by the max. ALWAYS
// ADD NEW VALUES BEFORE THIS ONE.
GET_HASH_RESULT_MAX