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/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/bind.h" | 10 #include "base/bind.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 // The default SafeBrowsingDatabaseFactory. | 313 // The default SafeBrowsingDatabaseFactory. |
314 class SafeBrowsingDatabaseFactoryImpl : public SafeBrowsingDatabaseFactory { | 314 class SafeBrowsingDatabaseFactoryImpl : public SafeBrowsingDatabaseFactory { |
315 public: | 315 public: |
316 virtual SafeBrowsingDatabase* CreateSafeBrowsingDatabase( | 316 virtual SafeBrowsingDatabase* CreateSafeBrowsingDatabase( |
317 bool enable_download_protection, | 317 bool enable_download_protection, |
318 bool enable_client_side_whitelist, | 318 bool enable_client_side_whitelist, |
319 bool enable_download_whitelist, | 319 bool enable_download_whitelist, |
320 bool enable_extension_blacklist, | 320 bool enable_extension_blacklist, |
321 bool enable_side_effect_free_whitelist, | 321 bool enable_side_effect_free_whitelist, |
322 bool enable_ip_blacklist) OVERRIDE { | 322 bool enable_ip_blacklist) override { |
323 return new SafeBrowsingDatabaseNew( | 323 return new SafeBrowsingDatabaseNew( |
324 new SafeBrowsingStoreFile, | 324 new SafeBrowsingStoreFile, |
325 enable_download_protection ? new SafeBrowsingStoreFile : NULL, | 325 enable_download_protection ? new SafeBrowsingStoreFile : NULL, |
326 enable_client_side_whitelist ? new SafeBrowsingStoreFile : NULL, | 326 enable_client_side_whitelist ? new SafeBrowsingStoreFile : NULL, |
327 enable_download_whitelist ? new SafeBrowsingStoreFile : NULL, | 327 enable_download_whitelist ? new SafeBrowsingStoreFile : NULL, |
328 enable_extension_blacklist ? new SafeBrowsingStoreFile : NULL, | 328 enable_extension_blacklist ? new SafeBrowsingStoreFile : NULL, |
329 enable_side_effect_free_whitelist ? new SafeBrowsingStoreFile : NULL, | 329 enable_side_effect_free_whitelist ? new SafeBrowsingStoreFile : NULL, |
330 enable_ip_blacklist ? new SafeBrowsingStoreFile : NULL); | 330 enable_ip_blacklist ? new SafeBrowsingStoreFile : NULL); |
331 } | 331 } |
332 | 332 |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() { | 1567 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() { |
1568 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl); | 1568 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl); |
1569 std::vector<SBFullHash> full_hashes; | 1569 std::vector<SBFullHash> full_hashes; |
1570 full_hashes.push_back(malware_kill_switch); | 1570 full_hashes.push_back(malware_kill_switch); |
1571 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes); | 1571 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes); |
1572 } | 1572 } |
1573 | 1573 |
1574 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() { | 1574 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() { |
1575 return csd_whitelist_.second; | 1575 return csd_whitelist_.second; |
1576 } | 1576 } |
OLD | NEW |