OLD | NEW |
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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 LocalSafeBrowsingDatabaseManager::~LocalSafeBrowsingDatabaseManager() { | 304 LocalSafeBrowsingDatabaseManager::~LocalSafeBrowsingDatabaseManager() { |
305 // The DCHECK is disabled due to crbug.com/438754. | 305 // The DCHECK is disabled due to crbug.com/438754. |
306 // DCHECK_CURRENTLY_ON(BrowserThread::UI); | 306 // DCHECK_CURRENTLY_ON(BrowserThread::UI); |
307 | 307 |
308 // We should have already been shut down. If we're still enabled, then the | 308 // We should have already been shut down. If we're still enabled, then the |
309 // database isn't going to be closed properly, which could lead to corruption. | 309 // database isn't going to be closed properly, which could lead to corruption. |
310 DCHECK(!enabled_); | 310 DCHECK(!enabled_); |
311 } | 311 } |
312 | 312 |
| 313 bool LocalSafeBrowsingDatabaseManager::IsSupported() const { |
| 314 return true; |
| 315 } |
| 316 |
313 bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { | 317 bool LocalSafeBrowsingDatabaseManager::CanCheckUrl(const GURL& url) const { |
314 return url.SchemeIs(url::kFtpScheme) || | 318 return url.SchemeIs(url::kFtpScheme) || |
315 url.SchemeIs(url::kHttpScheme) || | 319 url.SchemeIs(url::kHttpScheme) || |
316 url.SchemeIs(url::kHttpsScheme); | 320 url.SchemeIs(url::kHttpsScheme); |
317 } | 321 } |
318 | 322 |
319 bool LocalSafeBrowsingDatabaseManager::CheckDownloadUrl( | 323 bool LocalSafeBrowsingDatabaseManager::CheckDownloadUrl( |
320 const std::vector<GURL>& url_chain, | 324 const std::vector<GURL>& url_chain, |
321 Client* client) { | 325 Client* client) { |
322 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 326 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 check->weak_ptr_factory_->GetWeakPtr(), check)); | 1172 check->weak_ptr_factory_->GetWeakPtr(), check)); |
1169 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 1173 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
1170 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, | 1174 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, |
1171 check->weak_ptr_factory_->GetWeakPtr(), check), | 1175 check->weak_ptr_factory_->GetWeakPtr(), check), |
1172 check_timeout_); | 1176 check_timeout_); |
1173 } | 1177 } |
1174 | 1178 |
1175 bool LocalSafeBrowsingDatabaseManager::download_protection_enabled() const { | 1179 bool LocalSafeBrowsingDatabaseManager::download_protection_enabled() const { |
1176 return enable_download_protection_; | 1180 return enable_download_protection_; |
1177 } | 1181 } |
OLD | NEW |