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

Unified Diff: chrome/browser/download/download_resource_throttle.cc

Issue 9316116: Isolate initiation counts for downloads to their own histograms and improve (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to LKGR. Created 8 years, 10 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 | « chrome/browser/chromeos/imageburner/burn_manager.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_resource_throttle.cc
diff --git a/chrome/browser/download/download_resource_throttle.cc b/chrome/browser/download/download_resource_throttle.cc
index 9a86dd6691c05d586c2815c8c6843c939bd94810..83a961aa4e5b6282109dce7a4f0b409fc6be6535 100644
--- a/chrome/browser/download/download_resource_throttle.cc
+++ b/chrome/browser/download/download_resource_throttle.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/download/download_resource_throttle.h"
#include "base/bind.h"
+#include "chrome/browser/download/download_util.h"
#include "content/public/browser/resource_throttle_controller.h"
DownloadResourceThrottle::DownloadResourceThrottle(
@@ -40,6 +41,14 @@ void DownloadResourceThrottle::WillProcessResponse(bool* defer) {
void DownloadResourceThrottle::ContinueDownload(bool allow) {
request_allowed_ = allow;
+ if (allow) {
+ // Presumes all downloads initiated by navigation using this throttle and
+ // nothing else does.
+ download_util::RecordDownloadSource(
+ download_util::INITIATED_BY_NAVIGATION);
+ } else {
+ download_util::RecordDownloadCount(download_util::BLOCKED_BY_THROTTLING);
+ }
if (request_deferred_) {
if (allow) {
« no previous file with comments | « chrome/browser/chromeos/imageburner/burn_manager.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698