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

Side by Side Diff: chrome/browser/safe_browsing/local_database_manager.cc

Issue 2925233002: Enable SafeBrowsing lookups for ws: and wss: URLs (Closed)
Patch Set: Accidentally removed ftp: URLs. Fixed. Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/safe_browsing_db/remote_database_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/local_database_manager.h" 5 #include "chrome/browser/safe_browsing/local_database_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 return false; 329 return false;
330 } 330 }
331 331
332 bool LocalSafeBrowsingDatabaseManager::CanCheckResourceType( 332 bool LocalSafeBrowsingDatabaseManager::CanCheckResourceType(
333 content::ResourceType resource_type) const { 333 content::ResourceType resource_type) const {
334 // We check all types since most checks are fast. 334 // We check all types since most checks are fast.
335 return true; 335 return true;
336 } 336 }
337 337
338 bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { 338 bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const {
339 return url.SchemeIs(url::kFtpScheme) || url.SchemeIs(url::kHttpScheme) || 339 return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) ||
340 url.SchemeIs(url::kHttpsScheme); 340 url.SchemeIsWSOrWSS();
341 } 341 }
342 342
343 bool LocalSafeBrowsingDatabaseManager::CheckDownloadUrl( 343 bool LocalSafeBrowsingDatabaseManager::CheckDownloadUrl(
344 const std::vector<GURL>& url_chain, 344 const std::vector<GURL>& url_chain,
345 Client* client) { 345 Client* client) {
346 DCHECK_CURRENTLY_ON(BrowserThread::IO); 346 DCHECK_CURRENTLY_ON(BrowserThread::IO);
347 if (!enabled_ || !enable_download_protection_) 347 if (!enabled_ || !enable_download_protection_)
348 return true; 348 return true;
349 349
350 // We need to check the database for url prefix, and later may fetch the url 350 // We need to check the database for url prefix, and later may fetch the url
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 base::BindOnce(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, 1262 base::BindOnce(&LocalSafeBrowsingDatabaseManager::TimeoutCallback,
1263 check_ptr->weak_ptr_factory_->GetWeakPtr(), check_ptr), 1263 check_ptr->weak_ptr_factory_->GetWeakPtr(), check_ptr),
1264 check_timeout_); 1264 check_timeout_);
1265 } 1265 }
1266 1266
1267 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const { 1267 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const {
1268 return enable_download_protection_; 1268 return enable_download_protection_;
1269 } 1269 }
1270 1270
1271 } // namespace safe_browsing 1271 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/remote_database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698