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

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

Issue 1343293004: Don't check URLs against Safe Browsing if not supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: braces, per the thestig Created 5 years, 3 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/safe_browsing/remote_database_manager.cc
diff --git a/chrome/browser/safe_browsing/remote_database_manager.cc b/chrome/browser/safe_browsing/remote_database_manager.cc
index f01d4a860fb0754393e14b572f19e37aa5f5886d..e789f44b69f1ac6fe297d155c236edc8415dcbe8 100644
--- a/chrome/browser/safe_browsing/remote_database_manager.cc
+++ b/chrome/browser/safe_browsing/remote_database_manager.cc
@@ -86,6 +86,10 @@ RemoteSafeBrowsingDatabaseManager::~RemoteSafeBrowsingDatabaseManager() {
DCHECK(!enabled_);
}
+bool RemoteSafeBrowsingDatabaseManager::IsSupported() const {
+ return SafeBrowsingApiHandler::GetInstance() != nullptr;
+}
+
bool RemoteSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const {
return url.SchemeIs(url::kHttpsScheme) || url.SchemeIs(url::kHttpScheme) ||
url.SchemeIs(url::kFtpScheme);
@@ -165,8 +169,8 @@ bool RemoteSafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url,
DVLOG(1) << "Checking for client " << client << " and URL " << url;
SafeBrowsingApiHandler* api_handler = SafeBrowsingApiHandler::GetInstance();
- // If your build hits this at run time, then you should have either not built
- // with safe_browsing=3, or set a SafeBrowingApiHandler singleton at startup.
+ // This shouldn't happen since SafeBrowsingResourceThrottle checks
+ // IsSupported() ealier.
DCHECK(api_handler) << "SafeBrowsingApiHandler was never constructed";
api_handler->StartURLCheck(
base::Bind(&ClientRequest::OnRequestDoneWeak, req->GetWeakPtr()), url,
« no previous file with comments | « chrome/browser/safe_browsing/remote_database_manager.h ('k') | chrome/browser/safe_browsing/test_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698