diff options
Diffstat (limited to 'chrome/browser')
3 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 904e488..04ec974 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -138,7 +138,7 @@ void SafeBrowsingService::Client::OnSafeBrowsingResult( OnBrowseUrlCheckResult(*(check.url), check.result); OnDownloadUrlCheckResult(*(check.url), check.result); } else if (check.full_hash.get()) { - OnDownloadHashCheckResult(*(check.full_hash), check.result); + OnDownloadHashCheckResult(check.full_hash->full_hash, check.result); } else { NOTREACHED(); } @@ -219,7 +219,8 @@ bool SafeBrowsingService::CheckDownloadUrl(const GURL& url, bool SafeBrowsingService::CheckDownloadHash(const std::string& full_hash, Client* client) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - if (!enabled_ || !enable_download_protection_) + DCHECK(!full_hash.empty()); + if (!enabled_ || !enable_download_protection_ || full_hash.empty()) return true; // We need to check the database for url prefix, and later may fetch the url diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index eea01ee..2e4a596 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -115,7 +115,7 @@ class SafeBrowsingService UrlCheckResult result) {} // Called when the result of checking a download binary hash is known. - virtual void OnDownloadHashCheckResult(const SBFullHash& hash, + virtual void OnDownloadHashCheckResult(const std::string& hash, UrlCheckResult result) {} }; diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index f39d386..44c4be8 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc @@ -433,7 +433,7 @@ class TestSBClient } // Called when the result of checking a download hash is known. - void OnDownloadHashCheckResult(const SBFullHash& hash, + void OnDownloadHashCheckResult(const std::string& hash, SafeBrowsingService::UrlCheckResult result) { result_ = result; BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |