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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 // Used to verify that various calls are made from the thread the | 412 // Used to verify that various calls are made from the thread the |
413 // object was created on. | 413 // object was created on. |
414 base::MessageLoop* creation_loop_; | 414 base::MessageLoop* creation_loop_; |
415 | 415 |
416 // Lock for protecting access to variables that may be used on the | 416 // Lock for protecting access to variables that may be used on the |
417 // IO thread. This includes |prefix_set_|, |cached_browse_hashes_|, | 417 // IO thread. This includes |prefix_set_|, |cached_browse_hashes_|, |
418 // |prefix_miss_cache_|, |csd_whitelist_|. | 418 // |prefix_miss_cache_|, |csd_whitelist_|. |
419 base::Lock lookup_lock_; | 419 base::Lock lookup_lock_; |
420 | 420 |
| 421 // The base filename passed to Init(), used to generate the store and prefix |
| 422 // set filenames used to store data on disk. |
| 423 base::FilePath filename_base_; |
| 424 |
421 // Underlying persistent store for chunk data. | 425 // Underlying persistent store for chunk data. |
422 // For browsing related (phishing and malware URLs) chunks and prefixes. | 426 // For browsing related (phishing and malware URLs) chunks and prefixes. |
423 base::FilePath browse_filename_; | |
424 scoped_ptr<SafeBrowsingStore> browse_store_; | 427 scoped_ptr<SafeBrowsingStore> browse_store_; |
425 | 428 |
426 // For download related (download URL and binary hash) chunks and prefixes. | 429 // For download related (download URL and binary hash) chunks and prefixes. |
427 base::FilePath download_filename_; | |
428 scoped_ptr<SafeBrowsingStore> download_store_; | 430 scoped_ptr<SafeBrowsingStore> download_store_; |
429 | 431 |
430 // For the client-side phishing detection whitelist chunks and full-length | 432 // For the client-side phishing detection whitelist chunks and full-length |
431 // hashes. This list only contains 256 bit hashes. | 433 // hashes. This list only contains 256 bit hashes. |
432 base::FilePath csd_whitelist_filename_; | |
433 scoped_ptr<SafeBrowsingStore> csd_whitelist_store_; | 434 scoped_ptr<SafeBrowsingStore> csd_whitelist_store_; |
434 | 435 |
435 // For the download whitelist chunks and full-length hashes. This list only | 436 // For the download whitelist chunks and full-length hashes. This list only |
436 // contains 256 bit hashes. | 437 // contains 256 bit hashes. |
437 base::FilePath download_whitelist_filename_; | |
438 scoped_ptr<SafeBrowsingStore> download_whitelist_store_; | 438 scoped_ptr<SafeBrowsingStore> download_whitelist_store_; |
439 | 439 |
440 // For extension IDs. | 440 // For extension IDs. |
441 base::FilePath extension_blacklist_filename_; | |
442 scoped_ptr<SafeBrowsingStore> extension_blacklist_store_; | 441 scoped_ptr<SafeBrowsingStore> extension_blacklist_store_; |
443 | 442 |
444 // For side-effect free whitelist. | 443 // For side-effect free whitelist. |
445 base::FilePath side_effect_free_whitelist_filename_; | |
446 scoped_ptr<SafeBrowsingStore> side_effect_free_whitelist_store_; | 444 scoped_ptr<SafeBrowsingStore> side_effect_free_whitelist_store_; |
447 | 445 |
448 // For IP blacklist. | 446 // For IP blacklist. |
449 base::FilePath ip_blacklist_filename_; | |
450 scoped_ptr<SafeBrowsingStore> ip_blacklist_store_; | 447 scoped_ptr<SafeBrowsingStore> ip_blacklist_store_; |
451 | 448 |
452 SBWhitelist csd_whitelist_; | 449 SBWhitelist csd_whitelist_; |
453 SBWhitelist download_whitelist_; | 450 SBWhitelist download_whitelist_; |
454 SBWhitelist extension_blacklist_; | 451 SBWhitelist extension_blacklist_; |
455 | 452 |
456 // The IP blacklist should be small. At most a couple hundred IPs. | 453 // The IP blacklist should be small. At most a couple hundred IPs. |
457 IPBlacklist ip_blacklist_; | 454 IPBlacklist ip_blacklist_; |
458 | 455 |
459 // Store items from CacheHashResults(), ordered by hash for efficient | 456 // Store items from CacheHashResults(), ordered by hash for efficient |
(...skipping 11 matching lines...) Expand all Loading... |
471 // Set if corruption is detected during the course of an update. | 468 // Set if corruption is detected during the course of an update. |
472 // Causes the update functions to fail with no side effects, until | 469 // Causes the update functions to fail with no side effects, until |
473 // the next call to |UpdateStarted()|. | 470 // the next call to |UpdateStarted()|. |
474 bool corruption_detected_; | 471 bool corruption_detected_; |
475 | 472 |
476 // Set to true if any chunks are added or deleted during an update. | 473 // Set to true if any chunks are added or deleted during an update. |
477 // Used to optimize away database update. | 474 // Used to optimize away database update. |
478 bool change_detected_; | 475 bool change_detected_; |
479 | 476 |
480 // Used to check if a prefix was in the browse database. | 477 // Used to check if a prefix was in the browse database. |
481 base::FilePath browse_prefix_set_filename_; | |
482 scoped_ptr<safe_browsing::PrefixSet> browse_prefix_set_; | 478 scoped_ptr<safe_browsing::PrefixSet> browse_prefix_set_; |
483 | 479 |
484 // Used to check if a prefix was in the browse database. | 480 // Used to check if a prefix was in the browse database. |
485 base::FilePath side_effect_free_whitelist_prefix_set_filename_; | |
486 scoped_ptr<safe_browsing::PrefixSet> side_effect_free_whitelist_prefix_set_; | 481 scoped_ptr<safe_browsing::PrefixSet> side_effect_free_whitelist_prefix_set_; |
487 }; | 482 }; |
488 | 483 |
489 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ | 484 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ |
OLD | NEW |