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 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 SBWhitelist extension_blacklist_; | 449 SBWhitelist extension_blacklist_; |
450 | 450 |
451 // The IP blacklist should be small. At most a couple hundred IPs. | 451 // The IP blacklist should be small. At most a couple hundred IPs. |
452 IPBlacklist ip_blacklist_; | 452 IPBlacklist ip_blacklist_; |
453 | 453 |
454 // Cache of gethash results for browse store. Entries should not be used if | 454 // Cache of gethash results for browse store. Entries should not be used if |
455 // they are older than their expire_after field. Cached misses will have | 455 // they are older than their expire_after field. Cached misses will have |
456 // empty full_hashes field. Cleared on each update. | 456 // empty full_hashes field. Cleared on each update. |
457 std::map<SBPrefix, SBCachedFullHashResult> browse_gethash_cache_; | 457 std::map<SBPrefix, SBCachedFullHashResult> browse_gethash_cache_; |
458 | 458 |
459 // Used to schedule resetting the database because of corruption. | |
460 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_; | |
461 | |
462 // Set if corruption is detected during the course of an update. | 459 // Set if corruption is detected during the course of an update. |
463 // Causes the update functions to fail with no side effects, until | 460 // Causes the update functions to fail with no side effects, until |
464 // the next call to |UpdateStarted()|. | 461 // the next call to |UpdateStarted()|. |
465 bool corruption_detected_; | 462 bool corruption_detected_; |
466 | 463 |
467 // Set to true if any chunks are added or deleted during an update. | 464 // Set to true if any chunks are added or deleted during an update. |
468 // Used to optimize away database update. | 465 // Used to optimize away database update. |
469 bool change_detected_; | 466 bool change_detected_; |
470 | 467 |
471 // Used to check if a prefix was in the browse database. | 468 // Used to check if a prefix was in the browse database. |
472 scoped_ptr<safe_browsing::PrefixSet> browse_prefix_set_; | 469 scoped_ptr<safe_browsing::PrefixSet> browse_prefix_set_; |
473 | 470 |
474 // Used to check if a prefix was in the browse database. | 471 // Used to check if a prefix was in the browse database. |
475 scoped_ptr<safe_browsing::PrefixSet> side_effect_free_whitelist_prefix_set_; | 472 scoped_ptr<safe_browsing::PrefixSet> side_effect_free_whitelist_prefix_set_; |
| 473 |
| 474 // Used to schedule resetting the database because of corruption. |
| 475 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_; |
476 }; | 476 }; |
477 | 477 |
478 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ | 478 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ |
OLD | NEW |