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); |
}; |