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

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

Issue 8600006: Track download request time and always send back the hash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Err. Created 9 years, 1 month 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 | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a2d196a01217f2051381f66ce5fd987074fe9d5a..d9328a98f64bd2b149fd1caacc4b3ad7f5c29d92 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -340,7 +340,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
sb_service_(sb_service),
pingback_enabled_(service_->enabled()),
finished_(false),
- ALLOW_THIS_IN_INITIALIZER_LIST(timeout_weakptr_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(timeout_weakptr_factory_(this)),
+ start_time_(base::TimeTicks::Now()) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -440,6 +441,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
// We don't need the fetcher anymore.
fetcher_.reset();
RecordImprovedProtectionStats(reason);
+ UMA_HISTOGRAM_TIMES("SBClientDownload.DownloadRequestDuration",
+ base::TimeTicks::Now() - start_time_);
FinishRequest(result);
}
@@ -617,6 +620,7 @@ class DownloadProtectionService::CheckClientDownloadRequest
scoped_ptr<content::URLFetcher> fetcher_;
bool finished_;
base::WeakPtrFactory<CheckClientDownloadRequest> timeout_weakptr_factory_;
+ base::TimeTicks start_time_; // Used for stats.
DISALLOW_COPY_AND_ASSIGN(CheckClientDownloadRequest);
};
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698