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

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

Issue 19599012: Add detailed histograms for DownloadProtectionService URLFetcher errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 5 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/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 2c5f5901c2a16f35211e953f68a0f5a351bfe2ab..f111dd260c7dceb2ad23e7315c2109639c25721c 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -388,6 +389,18 @@ class DownloadProtectionService::CheckClientDownloadRequest
<< item_->GetUrlChain().back() << ": success="
<< source->GetStatus().is_success() << " response_code="
<< source->GetResponseCode();
+ UMA_HISTOGRAM_ENUMERATION("SBClientDownload.CheckDownloadRequestStatus",
+ source->GetStatus().status(),
+ net::URLRequestStatus::STATUS_MAX);
mmenke 2013/07/24 14:26:50 I'm not sure this is needed - this seems pretty re
mattm 2013/07/24 22:39:27 Sounds good, I didn't realize CANCELED would have
+ if (source->GetStatus().is_success()) {
mattm 2013/07/24 02:19:00 is "is_success()" right here, or should I check "s
mmenke 2013/07/24 14:26:50 I think is_success() is the way to go.
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "SBClientDownload.CheckDownloadRequestResponseCode",
+ source->GetResponseCode());
+ } else if (source->GetStatus().status() == net::URLRequestStatus::FAILED) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "SBClientDownload.CheckDownloadRequestNetError",
+ source->GetStatus().error());
mmenke 2013/07/24 14:26:50 This should be "-source->GetStatus().error()". Ne
mattm 2013/07/24 22:39:27 Done.
+ }
DownloadCheckResultReason reason = REASON_SERVER_PING_FAILED;
DownloadCheckResult result = SAFE;
if (source->GetStatus().is_success() &&
« no previous file with comments | « no previous file | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | net/url_request/url_request_status.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698