| 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 3af48ae41417b843685e5cd81ad17fe029ea78cb..f334d1c6867a4fbb48d2c24e41154c0d5f23bb15 100644
|
| --- a/chrome/browser/safe_browsing/download_protection_service.cc
|
| +++ b/chrome/browser/safe_browsing/download_protection_service.cc
|
| @@ -732,6 +732,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
|
| return;
|
| }
|
|
|
| + service_->client_download_request_callbacks_.Notify(item_, &request);
|
| +
|
| VLOG(2) << "Sending a request for URL: "
|
| << item_->GetUrlChain().back();
|
| fetcher_.reset(net::URLFetcher::Create(0 /* ID used for testing */,
|
| @@ -782,6 +784,14 @@ class DownloadProtectionService::CheckClientDownloadRequest
|
| base::TimeTicks::Now() - timeout_start_time_);
|
| }
|
| }
|
| + if (result == SAFE && (reason == REASON_WHITELISTED_URL ||
|
| + reason == REASON_TRUSTED_EXECUTABLE)) {
|
| + // A ClientDownloadRequest was not generated for this download, so
|
| + // callbacks were not run with one. Run them with null so they see that a
|
| + // previously-seen ClientDownloadRequest is now stale.
|
| + // TODO(grt): persist metadata for these downloads as well.
|
| + service_->client_download_request_callbacks_.Notify(item_, nullptr);
|
| + }
|
| if (service_) {
|
| VLOG(2) << "SafeBrowsing download verdict for: "
|
| << item_->DebugString(true) << " verdict:" << reason
|
| @@ -961,6 +971,12 @@ bool DownloadProtectionService::IsSupportedDownload(
|
| #endif
|
| }
|
|
|
| +DownloadProtectionService::ClientDownloadRequestSubscription
|
| +DownloadProtectionService::RegisterClientDownloadRequestCallback(
|
| + const ClientDownloadRequestCallback& callback) {
|
| + return client_download_request_callbacks_.Add(callback);
|
| +}
|
| +
|
| void DownloadProtectionService::CancelPendingRequests() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| for (std::set<scoped_refptr<CheckClientDownloadRequest> >::iterator it =
|
|
|