| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // This file should not be build on Android but is currently getting built. | 5 // This file should not be build on Android but is currently getting built. |
| 6 // TODO(vakh): Fix that: http://crbug.com/621647 | 6 // TODO(vakh): Fix that: http://crbug.com/621647 |
| 7 | 7 |
| 8 #include "components/safe_browsing_db/v4_local_database_manager.h" | 8 #include "components/safe_browsing_db/v4_local_database_manager.h" |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 bool V4LocalDatabaseManager::CanCheckResourceType( | 196 bool V4LocalDatabaseManager::CanCheckResourceType( |
| 197 content::ResourceType resource_type) const { | 197 content::ResourceType resource_type) const { |
| 198 // We check all types since most checks are fast. | 198 // We check all types since most checks are fast. |
| 199 return true; | 199 return true; |
| 200 } | 200 } |
| 201 | 201 |
| 202 bool V4LocalDatabaseManager::CanCheckUrl(const GURL& url) const { | 202 bool V4LocalDatabaseManager::CanCheckUrl(const GURL& url) const { |
| 203 return url.SchemeIs(url::kHttpsScheme) || url.SchemeIs(url::kHttpScheme) || | 203 return url.SchemeIsHTTPOrHTTPS() || url.SchemeIs(url::kFtpScheme) || |
| 204 url.SchemeIs(url::kFtpScheme); | 204 url.SchemeIsWSOrWSS(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 bool V4LocalDatabaseManager::ChecksAreAlwaysAsync() const { | 207 bool V4LocalDatabaseManager::ChecksAreAlwaysAsync() const { |
| 208 return false; | 208 return false; |
| 209 } | 209 } |
| 210 | 210 |
| 211 bool V4LocalDatabaseManager::CheckBrowseUrl(const GURL& url, Client* client) { | 211 bool V4LocalDatabaseManager::CheckBrowseUrl(const GURL& url, Client* client) { |
| 212 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 212 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 213 | 213 |
| 214 if (!enabled_ || !CanCheckUrl(url)) { | 214 if (!enabled_ || !CanCheckUrl(url)) { |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 v4_database_->AreAllStoresAvailable(stores_to_check); | 831 v4_database_->AreAllStoresAvailable(stores_to_check); |
| 832 } | 832 } |
| 833 | 833 |
| 834 bool V4LocalDatabaseManager::AreAnyStoresAvailableNow( | 834 bool V4LocalDatabaseManager::AreAnyStoresAvailableNow( |
| 835 const StoresToCheck& stores_to_check) const { | 835 const StoresToCheck& stores_to_check) const { |
| 836 return enabled_ && v4_database_ && | 836 return enabled_ && v4_database_ && |
| 837 v4_database_->AreAnyStoresAvailable(stores_to_check); | 837 v4_database_->AreAnyStoresAvailable(stores_to_check); |
| 838 } | 838 } |
| 839 | 839 |
| 840 } // namespace safe_browsing | 840 } // namespace safe_browsing |
| OLD | NEW |