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

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

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: addressed sky's nit Created 9 years, 5 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
Index: chrome/browser/download/download_safe_browsing_client.cc
===================================================================
--- chrome/browser/download/download_safe_browsing_client.cc (revision 92179)
+++ chrome/browser/download/download_safe_browsing_client.cc (working copy)
@@ -23,10 +23,12 @@
DownloadSBClient::DownloadSBClient(int32 download_id,
const std::vector<GURL>& url_chain,
- const GURL& referrer_url)
+ const GURL& referrer_url,
+ bool safe_browsing_enabled)
: download_id_(download_id),
url_chain_(url_chain),
- referrer_url_(referrer_url) {
+ referrer_url_(referrer_url),
+ safe_browsing_enabled_(safe_browsing_enabled) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!url_chain.empty());
ResourceDispatcherHost* rdh = g_browser_process->resource_dispatcher_host();
@@ -73,7 +75,8 @@
// Will be released in OnDownloadUrlCheckResult.
AddRef();
- if (sb_service_.get() && !sb_service_->CheckDownloadUrl(url_chain, this)) {
+ if (safe_browsing_enabled_ && sb_service_.get() &&
+ !sb_service_->CheckDownloadUrl(url_chain, this)) {
// Wait for SafeBrowsingService to call back OnDownloadUrlCheckResult.
return;
}
@@ -97,7 +100,8 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// Will be released in OnDownloadUrlCheckResult.
AddRef();
- if (sb_service_.get() && !sb_service_->CheckDownloadHash(hash, this)) {
+ if (safe_browsing_enabled_ && sb_service_.get() &&
+ !sb_service_->CheckDownloadHash(hash, this)) {
// Wait for SafeBrowsingService to call back OnDownloadUrlCheckResult.
return;
}

Powered by Google App Engine
This is Rietveld 408576698