OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/safe_browsing_database.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 return FilePath(db_filename.value() + kBloomFilterFile); | 442 return FilePath(db_filename.value() + kBloomFilterFile); |
443 } | 443 } |
444 | 444 |
445 // static | 445 // static |
446 FilePath SafeBrowsingDatabase::CsdWhitelistDBFilename( | 446 FilePath SafeBrowsingDatabase::CsdWhitelistDBFilename( |
447 const FilePath& db_filename) { | 447 const FilePath& db_filename) { |
448 return FilePath(db_filename.value() + kCsdWhitelistDBFile); | 448 return FilePath(db_filename.value() + kCsdWhitelistDBFile); |
449 } | 449 } |
450 | 450 |
451 SafeBrowsingStore* SafeBrowsingDatabaseNew::GetStore(const int list_id) { | 451 SafeBrowsingStore* SafeBrowsingDatabaseNew::GetStore(const int list_id) { |
452 DVLOG(3) << "Get store for list: " << list_id; | |
453 if (list_id == safe_browsing_util::PHISH || | 452 if (list_id == safe_browsing_util::PHISH || |
454 list_id == safe_browsing_util::MALWARE) { | 453 list_id == safe_browsing_util::MALWARE) { |
455 return browse_store_.get(); | 454 return browse_store_.get(); |
456 } else if (list_id == safe_browsing_util::BINURL || | 455 } else if (list_id == safe_browsing_util::BINURL || |
457 list_id == safe_browsing_util::BINHASH) { | 456 list_id == safe_browsing_util::BINHASH) { |
458 return download_store_.get(); | 457 return download_store_.get(); |
459 } else if (list_id == safe_browsing_util::CSDWHITELIST) { | 458 } else if (list_id == safe_browsing_util::CSDWHITELIST) { |
460 return csd_whitelist_store_.get(); | 459 return csd_whitelist_store_.get(); |
461 } | 460 } |
462 return NULL; | 461 return NULL; |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 if (std::binary_search(new_csd_whitelist.begin(), new_csd_whitelist.end(), | 1307 if (std::binary_search(new_csd_whitelist.begin(), new_csd_whitelist.end(), |
1309 kill_switch)) { | 1308 kill_switch)) { |
1310 // The kill switch is whitelisted hence we whitelist all URLs. | 1309 // The kill switch is whitelisted hence we whitelist all URLs. |
1311 CsdWhitelistAllUrls(); | 1310 CsdWhitelistAllUrls(); |
1312 } else { | 1311 } else { |
1313 base::AutoLock locked(lookup_lock_); | 1312 base::AutoLock locked(lookup_lock_); |
1314 csd_whitelist_all_urls_ = false; | 1313 csd_whitelist_all_urls_ = false; |
1315 csd_whitelist_.swap(new_csd_whitelist); | 1314 csd_whitelist_.swap(new_csd_whitelist); |
1316 } | 1315 } |
1317 } | 1316 } |
OLD | NEW |