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

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

Issue 1073633002: Remove PrerenderLocalPredictor, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-local-predictor-1
Patch Set: rebase Created 5 years, 8 months 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 21 matching lines...) Expand all
32 class SafeBrowsingDatabaseFactory { 32 class SafeBrowsingDatabaseFactory {
33 public: 33 public:
34 SafeBrowsingDatabaseFactory() { } 34 SafeBrowsingDatabaseFactory() { }
35 virtual ~SafeBrowsingDatabaseFactory() { } 35 virtual ~SafeBrowsingDatabaseFactory() { }
36 virtual SafeBrowsingDatabase* CreateSafeBrowsingDatabase( 36 virtual SafeBrowsingDatabase* CreateSafeBrowsingDatabase(
37 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 37 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
38 bool enable_download_protection, 38 bool enable_download_protection,
39 bool enable_client_side_whitelist, 39 bool enable_client_side_whitelist,
40 bool enable_download_whitelist, 40 bool enable_download_whitelist,
41 bool enable_extension_blacklist, 41 bool enable_extension_blacklist,
42 bool enable_side_effect_free_whitelist,
43 bool enable_ip_blacklist, 42 bool enable_ip_blacklist,
44 bool enable_unwanted_software_list) = 0; 43 bool enable_unwanted_software_list) = 0;
45 44
46 private: 45 private:
47 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactory); 46 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactory);
48 }; 47 };
49 48
50 // Encapsulates on-disk databases that for safebrowsing. There are 49 // Encapsulates on-disk databases that for safebrowsing. There are
51 // four databases: browse, download, download whitelist and 50 // four databases: browse, download, download whitelist and
52 // client-side detection (csd) whitelist databases. The browse database contains 51 // client-side detection (csd) whitelist databases. The browse database contains
(...skipping 11 matching lines...) Expand all
64 // Factory method for obtaining a SafeBrowsingDatabase implementation. 63 // Factory method for obtaining a SafeBrowsingDatabase implementation.
65 // It is not thread safe. 64 // It is not thread safe.
66 // The browse list and off-domain inclusion whitelist are always on; 65 // The browse list and off-domain inclusion whitelist are always on;
67 // availability of other lists is controlled by the flags on this method. 66 // availability of other lists is controlled by the flags on this method.
68 static SafeBrowsingDatabase* Create( 67 static SafeBrowsingDatabase* Create(
69 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 68 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
70 bool enable_download_protection, 69 bool enable_download_protection,
71 bool enable_client_side_whitelist, 70 bool enable_client_side_whitelist,
72 bool enable_download_whitelist, 71 bool enable_download_whitelist,
73 bool enable_extension_blacklist, 72 bool enable_extension_blacklist,
74 bool side_effect_free_whitelist,
75 bool enable_ip_blacklist, 73 bool enable_ip_blacklist,
76 bool enable_unwanted_software_list); 74 bool enable_unwanted_software_list);
77 75
78 // Makes the passed |factory| the factory used to instantiate 76 // Makes the passed |factory| the factory used to instantiate
79 // a SafeBrowsingDatabase. This is used for tests. 77 // a SafeBrowsingDatabase. This is used for tests.
80 static void RegisterFactory(SafeBrowsingDatabaseFactory* factory) { 78 static void RegisterFactory(SafeBrowsingDatabaseFactory* factory) {
81 factory_ = factory; 79 factory_ = factory;
82 } 80 }
83 81
84 virtual ~SafeBrowsingDatabase(); 82 virtual ~SafeBrowsingDatabase();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 virtual bool ContainsInclusionWhitelistedUrl(const GURL& url) = 0; 135 virtual bool ContainsInclusionWhitelistedUrl(const GURL& url) = 0;
138 136
139 // Populates |prefix_hits| with any prefixes in |prefixes| that have matches 137 // Populates |prefix_hits| with any prefixes in |prefixes| that have matches
140 // in the database, returning true if there were any matches. 138 // in the database, returning true if there were any matches.
141 // 139 //
142 // This function can ONLY be accessed from the creation thread. 140 // This function can ONLY be accessed from the creation thread.
143 virtual bool ContainsExtensionPrefixes( 141 virtual bool ContainsExtensionPrefixes(
144 const std::vector<SBPrefix>& prefixes, 142 const std::vector<SBPrefix>& prefixes,
145 std::vector<SBPrefix>* prefix_hits) = 0; 143 std::vector<SBPrefix>* prefix_hits) = 0;
146 144
147 // Returns false unless the hash of |url| is on the side-effect free
148 // whitelist. This function is safe to call from any thread.
149 virtual bool ContainsSideEffectFreeWhitelistUrl(const GURL& url) = 0;
150
151 // Returns true iff the given IP is currently on the csd malware IP blacklist. 145 // Returns true iff the given IP is currently on the csd malware IP blacklist.
152 // This function is safe to call from any thread. 146 // This function is safe to call from any thread.
153 virtual bool ContainsMalwareIP(const std::string& ip_address) = 0; 147 virtual bool ContainsMalwareIP(const std::string& ip_address) = 0;
154 148
155 // A database transaction should look like: 149 // A database transaction should look like:
156 // 150 //
157 // std::vector<SBListChunkRanges> lists; 151 // std::vector<SBListChunkRanges> lists;
158 // if (db.UpdateStarted(&lists)) { 152 // if (db.UpdateStarted(&lists)) {
159 // // Do something with |lists|. 153 // // Do something with |lists|.
160 // 154 //
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 const base::FilePath& download_whitelist_base_filename); 216 const base::FilePath& download_whitelist_base_filename);
223 217
224 // Filename for the off-domain inclusion whitelist databsae. 218 // Filename for the off-domain inclusion whitelist databsae.
225 static base::FilePath InclusionWhitelistDBFilename( 219 static base::FilePath InclusionWhitelistDBFilename(
226 const base::FilePath& inclusion_whitelist_base_filename); 220 const base::FilePath& inclusion_whitelist_base_filename);
227 221
228 // Filename for extension blacklist database. 222 // Filename for extension blacklist database.
229 static base::FilePath ExtensionBlacklistDBFilename( 223 static base::FilePath ExtensionBlacklistDBFilename(
230 const base::FilePath& extension_blacklist_base_filename); 224 const base::FilePath& extension_blacklist_base_filename);
231 225
232 // Filename for side-effect free whitelist database. 226 // Filename for side-effect free whitelist database. This database no longer
227 // exists, but the filename is retained so the database may be deleted.
233 static base::FilePath SideEffectFreeWhitelistDBFilename( 228 static base::FilePath SideEffectFreeWhitelistDBFilename(
234 const base::FilePath& side_effect_free_whitelist_base_filename); 229 const base::FilePath& side_effect_free_whitelist_base_filename);
235 230
236 // Filename for the csd malware IP blacklist database. 231 // Filename for the csd malware IP blacklist database.
237 static base::FilePath IpBlacklistDBFilename( 232 static base::FilePath IpBlacklistDBFilename(
238 const base::FilePath& ip_blacklist_base_filename); 233 const base::FilePath& ip_blacklist_base_filename);
239 234
240 // Filename for the unwanted software blacklist database. 235 // Filename for the unwanted software blacklist database.
241 static base::FilePath UnwantedSoftwareDBFilename( 236 static base::FilePath UnwantedSoftwareDBFilename(
242 const base::FilePath& db_filename); 237 const base::FilePath& db_filename);
(...skipping 19 matching lines...) Expand all
262 FAILURE_DOWNLOAD_DATABASE_UPDATE_BEGIN = 10, 257 FAILURE_DOWNLOAD_DATABASE_UPDATE_BEGIN = 10,
263 FAILURE_DOWNLOAD_DATABASE_UPDATE_FINISH = 11, 258 FAILURE_DOWNLOAD_DATABASE_UPDATE_FINISH = 11,
264 FAILURE_WHITELIST_DATABASE_UPDATE_BEGIN = 12, 259 FAILURE_WHITELIST_DATABASE_UPDATE_BEGIN = 12,
265 FAILURE_WHITELIST_DATABASE_UPDATE_FINISH = 13, 260 FAILURE_WHITELIST_DATABASE_UPDATE_FINISH = 13,
266 FAILURE_BROWSE_PREFIX_SET_READ = 14, 261 FAILURE_BROWSE_PREFIX_SET_READ = 14,
267 FAILURE_BROWSE_PREFIX_SET_WRITE = 15, 262 FAILURE_BROWSE_PREFIX_SET_WRITE = 15,
268 FAILURE_BROWSE_PREFIX_SET_DELETE = 16, 263 FAILURE_BROWSE_PREFIX_SET_DELETE = 16,
269 FAILURE_EXTENSION_BLACKLIST_UPDATE_BEGIN = 17, 264 FAILURE_EXTENSION_BLACKLIST_UPDATE_BEGIN = 17,
270 FAILURE_EXTENSION_BLACKLIST_UPDATE_FINISH = 18, 265 FAILURE_EXTENSION_BLACKLIST_UPDATE_FINISH = 18,
271 FAILURE_EXTENSION_BLACKLIST_DELETE = 19, 266 FAILURE_EXTENSION_BLACKLIST_DELETE = 19,
272 FAILURE_SIDE_EFFECT_FREE_WHITELIST_UPDATE_BEGIN = 20, 267 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_UPDATE_BEGIN = 20,
273 FAILURE_SIDE_EFFECT_FREE_WHITELIST_UPDATE_FINISH = 21, 268 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_UPDATE_FINISH = 21,
274 FAILURE_SIDE_EFFECT_FREE_WHITELIST_DELETE = 22, 269 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_DELETE = 22,
275 FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_READ = 23, 270 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_READ = 23,
276 FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_WRITE = 24, 271 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_WRITE = 24,
277 FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_DELETE = 25, 272 // Obsolete: FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_DELETE = 25,
278 FAILURE_IP_BLACKLIST_UPDATE_BEGIN = 26, 273 FAILURE_IP_BLACKLIST_UPDATE_BEGIN = 26,
279 FAILURE_IP_BLACKLIST_UPDATE_FINISH = 27, 274 FAILURE_IP_BLACKLIST_UPDATE_FINISH = 27,
280 FAILURE_IP_BLACKLIST_UPDATE_INVALID = 28, 275 FAILURE_IP_BLACKLIST_UPDATE_INVALID = 28,
281 FAILURE_IP_BLACKLIST_DELETE = 29, 276 FAILURE_IP_BLACKLIST_DELETE = 29,
282 FAILURE_UNWANTED_SOFTWARE_DATABASE_UPDATE_BEGIN = 30, 277 FAILURE_UNWANTED_SOFTWARE_DATABASE_UPDATE_BEGIN = 30,
283 FAILURE_UNWANTED_SOFTWARE_DATABASE_UPDATE_FINISH = 31, 278 FAILURE_UNWANTED_SOFTWARE_DATABASE_UPDATE_FINISH = 31,
284 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_READ = 32, 279 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_READ = 32,
285 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_WRITE = 33, 280 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_WRITE = 33,
286 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_DELETE = 34, 281 FAILURE_UNWANTED_SOFTWARE_PREFIX_SET_DELETE = 34,
287 282
(...skipping 17 matching lines...) Expand all
305 // objects handed to this constructor. Ignores all future operations on lists 300 // objects handed to this constructor. Ignores all future operations on lists
306 // for which the store is initialized to NULL. 301 // for which the store is initialized to NULL.
307 SafeBrowsingDatabaseNew( 302 SafeBrowsingDatabaseNew(
308 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 303 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
309 SafeBrowsingStore* browse_store, 304 SafeBrowsingStore* browse_store,
310 SafeBrowsingStore* download_store, 305 SafeBrowsingStore* download_store,
311 SafeBrowsingStore* csd_whitelist_store, 306 SafeBrowsingStore* csd_whitelist_store,
312 SafeBrowsingStore* download_whitelist_store, 307 SafeBrowsingStore* download_whitelist_store,
313 SafeBrowsingStore* inclusion_whitelist_store, 308 SafeBrowsingStore* inclusion_whitelist_store,
314 SafeBrowsingStore* extension_blacklist_store, 309 SafeBrowsingStore* extension_blacklist_store,
315 SafeBrowsingStore* side_effect_free_whitelist_store,
316 SafeBrowsingStore* ip_blacklist_store, 310 SafeBrowsingStore* ip_blacklist_store,
317 SafeBrowsingStore* unwanted_software_store); 311 SafeBrowsingStore* unwanted_software_store);
318 312
319 ~SafeBrowsingDatabaseNew() override; 313 ~SafeBrowsingDatabaseNew() override;
320 314
321 // Implement SafeBrowsingDatabase interface. 315 // Implement SafeBrowsingDatabase interface.
322 void Init(const base::FilePath& filename) override; 316 void Init(const base::FilePath& filename) override;
323 bool ResetDatabase() override; 317 bool ResetDatabase() override;
324 bool ContainsBrowseUrl(const GURL& url, 318 bool ContainsBrowseUrl(const GURL& url,
325 std::vector<SBPrefix>* prefix_hits, 319 std::vector<SBPrefix>* prefix_hits,
326 std::vector<SBFullHashResult>* cache_hits) override; 320 std::vector<SBFullHashResult>* cache_hits) override;
327 bool ContainsUnwantedSoftwareUrl( 321 bool ContainsUnwantedSoftwareUrl(
328 const GURL& url, 322 const GURL& url,
329 std::vector<SBPrefix>* prefix_hits, 323 std::vector<SBPrefix>* prefix_hits,
330 std::vector<SBFullHashResult>* cache_hits) override; 324 std::vector<SBFullHashResult>* cache_hits) override;
331 bool ContainsDownloadUrlPrefixes(const std::vector<SBPrefix>& prefixes, 325 bool ContainsDownloadUrlPrefixes(const std::vector<SBPrefix>& prefixes,
332 std::vector<SBPrefix>* prefix_hits) override; 326 std::vector<SBPrefix>* prefix_hits) override;
333 bool ContainsCsdWhitelistedUrl(const GURL& url) override; 327 bool ContainsCsdWhitelistedUrl(const GURL& url) override;
334 bool ContainsDownloadWhitelistedUrl(const GURL& url) override; 328 bool ContainsDownloadWhitelistedUrl(const GURL& url) override;
335 bool ContainsDownloadWhitelistedString(const std::string& str) override; 329 bool ContainsDownloadWhitelistedString(const std::string& str) override;
336 bool ContainsInclusionWhitelistedUrl(const GURL& url) override; 330 bool ContainsInclusionWhitelistedUrl(const GURL& url) override;
337 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes, 331 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes,
338 std::vector<SBPrefix>* prefix_hits) override; 332 std::vector<SBPrefix>* prefix_hits) override;
339 bool ContainsSideEffectFreeWhitelistUrl(const GURL& url) override;
340 bool ContainsMalwareIP(const std::string& ip_address) override; 333 bool ContainsMalwareIP(const std::string& ip_address) override;
341 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override; 334 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override;
342 void InsertChunks(const std::string& list_name, 335 void InsertChunks(const std::string& list_name,
343 const std::vector<SBChunkData*>& chunks) override; 336 const std::vector<SBChunkData*>& chunks) override;
344 void DeleteChunks(const std::vector<SBChunkDelete>& chunk_deletes) override; 337 void DeleteChunks(const std::vector<SBChunkDelete>& chunk_deletes) override;
345 void UpdateFinished(bool update_succeeded) override; 338 void UpdateFinished(bool update_succeeded) override;
346 void CacheHashResults(const std::vector<SBPrefix>& prefixes, 339 void CacheHashResults(const std::vector<SBPrefix>& prefixes,
347 const std::vector<SBFullHashResult>& full_hits, 340 const std::vector<SBFullHashResult>& full_hits,
348 const base::TimeDelta& cache_lifetime) override; 341 const base::TimeDelta& cache_lifetime) override;
349 342
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // methods to start a transaction themselves and keep it as short as 381 // methods to start a transaction themselves and keep it as short as
389 // possible rather than force callers to start the transaction early to pass 382 // possible rather than force callers to start the transaction early to pass
390 // a store pointer to the said helper methods. 383 // a store pointer to the said helper methods.
391 enum class SBWhitelistId { 384 enum class SBWhitelistId {
392 CSD, 385 CSD,
393 DOWNLOAD, 386 DOWNLOAD,
394 INCLUSION, 387 INCLUSION,
395 }; 388 };
396 enum class PrefixSetId { 389 enum class PrefixSetId {
397 BROWSE, 390 BROWSE,
398 SIDE_EFFECT_FREE_WHITELIST,
399 UNWANTED_SOFTWARE, 391 UNWANTED_SOFTWARE,
400 }; 392 };
401 393
402 // Obtained through BeginReadTransaction(NoLockOnMainTaskRunner)?(): a 394 // Obtained through BeginReadTransaction(NoLockOnMainTaskRunner)?(): a
403 // ReadTransaction allows read-only observations of the 395 // ReadTransaction allows read-only observations of the
404 // ThreadSafeStateManager's state. The |prefix_gethash_cache_| has a special 396 // ThreadSafeStateManager's state. The |prefix_gethash_cache_| has a special
405 // allowance to be writable from a ReadTransaction but can't benefit from 397 // allowance to be writable from a ReadTransaction but can't benefit from
406 // unlocked ReadTransactions. ReadTransaction should be held for the 398 // unlocked ReadTransactions. ReadTransaction should be held for the
407 // shortest amount of time possible (e.g., release it before computing final 399 // shortest amount of time possible (e.g., release it before computing final
408 // results if possible). 400 // results if possible).
(...skipping 25 matching lines...) Expand all
434 SBWhitelist download_whitelist_; 426 SBWhitelist download_whitelist_;
435 SBWhitelist inclusion_whitelist_; 427 SBWhitelist inclusion_whitelist_;
436 428
437 // The IP blacklist should be small. At most a couple hundred IPs. 429 // The IP blacklist should be small. At most a couple hundred IPs.
438 IPBlacklist ip_blacklist_; 430 IPBlacklist ip_blacklist_;
439 431
440 // PrefixSets to speed up lookups for particularly large lists. The 432 // PrefixSets to speed up lookups for particularly large lists. The
441 // PrefixSet themselves are never modified, instead a new one is swapped in 433 // PrefixSet themselves are never modified, instead a new one is swapped in
442 // on update. 434 // on update.
443 scoped_ptr<const safe_browsing::PrefixSet> browse_prefix_set_; 435 scoped_ptr<const safe_browsing::PrefixSet> browse_prefix_set_;
444 scoped_ptr<const safe_browsing::PrefixSet>
445 side_effect_free_whitelist_prefix_set_;
446 scoped_ptr<const safe_browsing::PrefixSet> unwanted_software_prefix_set_; 436 scoped_ptr<const safe_browsing::PrefixSet> unwanted_software_prefix_set_;
447 437
448 // Cache of gethash results for prefix stores. Entries should not be used if 438 // Cache of gethash results for prefix stores. Entries should not be used if
449 // they are older than their expire_after field. Cached misses will have 439 // they are older than their expire_after field. Cached misses will have
450 // empty full_hashes field. Cleared on each update. The cache is "mutable" 440 // empty full_hashes field. Cleared on each update. The cache is "mutable"
451 // as it can be written to from any transaction holding the lock, including 441 // as it can be written to from any transaction holding the lock, including
452 // ReadTransactions. 442 // ReadTransactions.
453 mutable PrefixGetHashCache prefix_gethash_cache_; 443 mutable PrefixGetHashCache prefix_gethash_cache_;
454 444
455 DISALLOW_COPY_AND_ASSIGN(ThreadSafeStateManager); 445 DISALLOW_COPY_AND_ASSIGN(ThreadSafeStateManager);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 // - |download_store_|: For download related (download URL and binary hash) 645 // - |download_store_|: For download related (download URL and binary hash)
656 // chunks and prefixes. 646 // chunks and prefixes.
657 // - |csd_whitelist_store_|: For the client-side phishing detection 647 // - |csd_whitelist_store_|: For the client-side phishing detection
658 // whitelist chunks and full-length hashes. This list only contains 256 648 // whitelist chunks and full-length hashes. This list only contains 256
659 // bit hashes. 649 // bit hashes.
660 // - |download_whitelist_store_|: For the download whitelist chunks and 650 // - |download_whitelist_store_|: For the download whitelist chunks and
661 // full-length hashes. This list only contains 256 bit hashes. 651 // full-length hashes. This list only contains 256 bit hashes.
662 // - |inclusion_whitelist_store_|: For the inclusion whitelist. Same format 652 // - |inclusion_whitelist_store_|: For the inclusion whitelist. Same format
663 // as |download_whitelist_store_|. 653 // as |download_whitelist_store_|.
664 // - |extension_blacklist_store_|: For extension IDs. 654 // - |extension_blacklist_store_|: For extension IDs.
665 // - |side_effect_free_whitelist_store_|: For side-effect free whitelist.
666 // - |ip_blacklist_store_|: For IP blacklist. 655 // - |ip_blacklist_store_|: For IP blacklist.
667 // - |unwanted_software_store_|: For unwanted software list (format 656 // - |unwanted_software_store_|: For unwanted software list (format
668 // identical to browsing lists). 657 // identical to browsing lists).
669 // 658 //
670 // The stores themselves will be modified throughout the existence of this 659 // The stores themselves will be modified throughout the existence of this
671 // database, but shouldn't ever be swapped out (hence the const scoped_ptr -- 660 // database, but shouldn't ever be swapped out (hence the const scoped_ptr --
672 // which could be swapped for C++11's std::optional when that's available). 661 // which could be swapped for C++11's std::optional when that's available).
673 // They are NonThreadSafe and should thus only be accessed on the database's 662 // They are NonThreadSafe and should thus only be accessed on the database's
674 // main thread as enforced by SafeBrowsingStoreFile's implementation. 663 // main thread as enforced by SafeBrowsingStoreFile's implementation.
675 const scoped_ptr<SafeBrowsingStore> browse_store_; 664 const scoped_ptr<SafeBrowsingStore> browse_store_;
676 const scoped_ptr<SafeBrowsingStore> download_store_; 665 const scoped_ptr<SafeBrowsingStore> download_store_;
677 const scoped_ptr<SafeBrowsingStore> csd_whitelist_store_; 666 const scoped_ptr<SafeBrowsingStore> csd_whitelist_store_;
678 const scoped_ptr<SafeBrowsingStore> download_whitelist_store_; 667 const scoped_ptr<SafeBrowsingStore> download_whitelist_store_;
679 const scoped_ptr<SafeBrowsingStore> inclusion_whitelist_store_; 668 const scoped_ptr<SafeBrowsingStore> inclusion_whitelist_store_;
680 const scoped_ptr<SafeBrowsingStore> extension_blacklist_store_; 669 const scoped_ptr<SafeBrowsingStore> extension_blacklist_store_;
681 const scoped_ptr<SafeBrowsingStore> side_effect_free_whitelist_store_;
682 const scoped_ptr<SafeBrowsingStore> ip_blacklist_store_; 670 const scoped_ptr<SafeBrowsingStore> ip_blacklist_store_;
683 const scoped_ptr<SafeBrowsingStore> unwanted_software_store_; 671 const scoped_ptr<SafeBrowsingStore> unwanted_software_store_;
684 672
685 // Used to schedule resetting the database because of corruption. This factory 673 // Used to schedule resetting the database because of corruption. This factory
686 // and the WeakPtrs it issues should only be used on the database's main 674 // and the WeakPtrs it issues should only be used on the database's main
687 // thread. 675 // thread.
688 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_; 676 base::WeakPtrFactory<SafeBrowsingDatabaseNew> reset_factory_;
689 }; 677 };
690 678
691 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ 679 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/database_manager.cc ('k') | chrome/browser/safe_browsing/safe_browsing_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698