| 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/database_manager.h" | 5 #include "chrome/browser/safe_browsing/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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 bool SafeBrowsingDatabaseManager::MatchDownloadWhitelistString( | 432 bool SafeBrowsingDatabaseManager::MatchDownloadWhitelistString( |
| 433 const std::string& str) { | 433 const std::string& str) { |
| 434 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 434 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 435 if (!enabled_ || !enable_download_whitelist_ || !MakeDatabaseAvailable()) { | 435 if (!enabled_ || !enable_download_whitelist_ || !MakeDatabaseAvailable()) { |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 return database_->ContainsDownloadWhitelistedString(str); | 438 return database_->ContainsDownloadWhitelistedString(str); |
| 439 } | 439 } |
| 440 | 440 |
| 441 bool SafeBrowsingDatabaseManager::MatchInclusionWhitelistUrl(const GURL& url) { |
| 442 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 443 if (!enabled_ || !MakeDatabaseAvailable()) |
| 444 return true; |
| 445 return database_->ContainsInclusionWhitelistedUrl(url); |
| 446 } |
| 447 |
| 441 bool SafeBrowsingDatabaseManager::IsMalwareKillSwitchOn() { | 448 bool SafeBrowsingDatabaseManager::IsMalwareKillSwitchOn() { |
| 442 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 449 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 443 if (!enabled_ || !MakeDatabaseAvailable()) { | 450 if (!enabled_ || !MakeDatabaseAvailable()) { |
| 444 return true; | 451 return true; |
| 445 } | 452 } |
| 446 return database_->IsMalwareIPMatchKillSwitchOn(); | 453 return database_->IsMalwareIPMatchKillSwitchOn(); |
| 447 } | 454 } |
| 448 | 455 |
| 449 bool SafeBrowsingDatabaseManager::IsCsdWhitelistKillSwitchOn() { | 456 bool SafeBrowsingDatabaseManager::IsCsdWhitelistKillSwitchOn() { |
| 450 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 457 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); | 1169 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); |
| 1163 checks_.insert(check); | 1170 checks_.insert(check); |
| 1164 | 1171 |
| 1165 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); | 1172 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); |
| 1166 | 1173 |
| 1167 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1174 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 1168 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, | 1175 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, |
| 1169 check->timeout_factory_->GetWeakPtr(), check), | 1176 check->timeout_factory_->GetWeakPtr(), check), |
| 1170 check_timeout_); | 1177 check_timeout_); |
| 1171 } | 1178 } |
| OLD | NEW |