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

Side by Side Diff: components/safe_browsing_db/remote_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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/safe_browsing_db/remote_database_manager.h" 5 #include "components/safe_browsing_db/remote_database_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 NOTREACHED(); 167 NOTREACHED();
168 } 168 }
169 169
170 bool RemoteSafeBrowsingDatabaseManager::CanCheckResourceType( 170 bool RemoteSafeBrowsingDatabaseManager::CanCheckResourceType(
171 content::ResourceType resource_type) const { 171 content::ResourceType resource_type) const {
172 return resource_types_to_check_.count(resource_type) > 0; 172 return resource_types_to_check_.count(resource_type) > 0;
173 } 173 }
174 174
175 bool RemoteSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { 175 bool RemoteSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const {
176 return url.SchemeIs(url::kHttpsScheme) || url.SchemeIs(url::kHttpScheme) || 176 return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) ||
177 url.SchemeIs(url::kFtpScheme); 177 url.SchemeIsWSOrWSS();
178 } 178 }
179 179
180 bool RemoteSafeBrowsingDatabaseManager::ChecksAreAlwaysAsync() const { 180 bool RemoteSafeBrowsingDatabaseManager::ChecksAreAlwaysAsync() const {
181 return true; 181 return true;
182 } 182 }
183 183
184 bool RemoteSafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url, 184 bool RemoteSafeBrowsingDatabaseManager::CheckBrowseUrl(const GURL& url,
185 Client* client) { 185 Client* client) {
186 DCHECK_CURRENTLY_ON(BrowserThread::IO); 186 DCHECK_CURRENTLY_ON(BrowserThread::IO);
187 if (!enabled_) 187 if (!enabled_)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 for (auto* req : to_callback) { 336 for (auto* req : to_callback) {
337 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url(); 337 DVLOG(1) << "Stopping: Invoking unfinished req for URL " << req->url();
338 req->OnRequestDone(SB_THREAT_TYPE_SAFE, ThreatMetadata()); 338 req->OnRequestDone(SB_THREAT_TYPE_SAFE, ThreatMetadata());
339 } 339 }
340 enabled_ = false; 340 enabled_ = false;
341 341
342 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown); 342 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown);
343 } 343 }
344 344
345 } // namespace safe_browsing 345 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/local_database_manager.cc ('k') | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698