Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_database.h

Issue 790703003: De-dup PrefixSet code in SafeBrowsingDatabaseManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a5_rm_unused_extensionsBL
Patch Set: +TODO Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 const SBChunkData& chunk); 444 const SBChunkData& chunk);
445 445
446 // Returns the size in bytes of the store after the update. 446 // Returns the size in bytes of the store after the update.
447 int64 UpdateHashPrefixStore(const base::FilePath& store_filename, 447 int64 UpdateHashPrefixStore(const base::FilePath& store_filename,
448 SafeBrowsingStore* store, 448 SafeBrowsingStore* store,
449 FailureType failure_type); 449 FailureType failure_type);
450 450
451 // Updates a PrefixStore store for URLs (|url_store|) which is backed on disk 451 // Updates a PrefixStore store for URLs (|url_store|) which is backed on disk
452 // by a "|db_filename| Prefix Set" file. Specific failure types are provided 452 // by a "|db_filename| Prefix Set" file. Specific failure types are provided
453 // to highlight the specific store who made the initial request on failure. 453 // to highlight the specific store who made the initial request on failure.
454 // |store_full_hashes_in_prefix_set| dictates whether full_hashes from the
455 // |url_store| should be cached in the |prefix_set| as well.
454 void UpdatePrefixSetUrlStore( 456 void UpdatePrefixSetUrlStore(
455 const base::FilePath& db_filename, 457 const base::FilePath& db_filename,
456 SafeBrowsingStore* url_store, 458 SafeBrowsingStore* url_store,
457 scoped_ptr<const safe_browsing::PrefixSet>* prefix_set, 459 scoped_ptr<const safe_browsing::PrefixSet>* prefix_set,
458 FailureType finish_failure_type, 460 FailureType finish_failure_type,
459 FailureType write_failure_type); 461 FailureType write_failure_type,
462 bool store_full_hashes_in_prefix_set);
460 463
461 void UpdateUrlStore(SafeBrowsingStore* url_store, 464 void UpdateUrlStore(SafeBrowsingStore* url_store,
462 scoped_ptr<const safe_browsing::PrefixSet>* prefix_set, 465 scoped_ptr<const safe_browsing::PrefixSet>* prefix_set,
463 FailureType failure_type); 466 FailureType failure_type);
464 467
465 void UpdateSideEffectFreeWhitelistStore();
466 void UpdateWhitelistStore(const base::FilePath& store_filename, 468 void UpdateWhitelistStore(const base::FilePath& store_filename,
467 SafeBrowsingStore* store, 469 SafeBrowsingStore* store,
468 SBWhitelist* whitelist); 470 SBWhitelist* whitelist);
469 void UpdateIpBlacklistStore(); 471 void UpdateIpBlacklistStore();
470 472
471 // Used to verify that various calls are made from the thread the 473 // Used to verify that various calls are made from the thread the
472 // object was created on (i.e., the safe_browsing_thread). 474 // object was created on (i.e., the safe_browsing_thread).
473 base::ThreadChecker thread_checker_; 475 base::ThreadChecker thread_checker_;
474 476
475 // The base filename passed to Init(), used to generate the store and prefix 477 // The base filename passed to Init(), used to generate the store and prefix
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 scoped_ptr<const safe_browsing::PrefixSet> browse_prefix_set_; 538 scoped_ptr<const safe_browsing::PrefixSet> browse_prefix_set_;
537 scoped_ptr<const safe_browsing::PrefixSet> 539 scoped_ptr<const safe_browsing::PrefixSet>
538 side_effect_free_whitelist_prefix_set_; 540 side_effect_free_whitelist_prefix_set_;
539 scoped_ptr<const safe_browsing::PrefixSet> unwanted_software_prefix_set_; 541 scoped_ptr<const safe_browsing::PrefixSet> unwanted_software_prefix_set_;
540 542
541 // Used to schedule resetting the database because of corruption. 543 // Used to schedule resetting the database because of corruption.
542 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_; 544 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_;
543 }; 545 };
544 546
545 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ 547 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_database.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698