Commit 52d6e906 authored by ricea's avatar ricea Committed by Commit Bot

Enable SafeBrowsing lookups for ws: and wss: URLs

Modify the three "real" implementations of SafeBrowsingDatabaseManager
to enable lookups for "ws:" and "wss:" URLs.

This change doesn't cause SafeBrowsing checks to be performed on
WebSocket URLs. No ws: or wss: URLs will be passed to the
SafeBrowsingDatabaseManager yet. It just ensures that they will actually
be looked up when a future change causes them to be checked.

This change is required for both designs described in the "WebSocket
SafeBrowsing Support" design document:
https://docs.google.com/document/d/1iR3XMIQukqlXb6ajIHE91apHZAxyF_wvRoB5JGeJYPs/edit

BUG=644744

Review-Url: https://codereview.chromium.org/2925233002
Cr-Commit-Position: refs/heads/master@{#478553}
parent d675ad14
......@@ -336,8 +336,8 @@ bool LocalSafeBrowsingDatabaseManager::CanCheckResourceType(
}
bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const {
return url.SchemeIs(url::kFtpScheme) || url.SchemeIs(url::kHttpScheme) ||
url.SchemeIs(url::kHttpsScheme);
return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) ||
url.SchemeIsWSOrWSS();
}
bool LocalSafeBrowsingDatabaseManager::CheckDownloadUrl(
......
......@@ -173,8 +173,8 @@ bool RemoteSafeBrowsingDatabaseManager::CanCheckResourceType(
}
bool RemoteSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const {
return url.SchemeIs(url::kHttpsScheme) || url.SchemeIs(url::kHttpScheme) ||
url.SchemeIs(url::kFtpScheme);
return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) ||
url.SchemeIsWSOrWSS();
}
bool RemoteSafeBrowsingDatabaseManager::ChecksAreAlwaysAsync() const {
......
......@@ -200,8 +200,8 @@ bool V4LocalDatabaseManager::CanCheckResourceType(
}
bool V4LocalDatabaseManager::CanCheckUrl(const GURL& url) const {
return url.SchemeIs(url::kHttpsScheme) || url.SchemeIs(url::kHttpScheme) ||
url.SchemeIs(url::kFtpScheme);
return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) ||
url.SchemeIsWSOrWSS();
}
bool V4LocalDatabaseManager::ChecksAreAlwaysAsync() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment