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

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

Issue 6286072: PrefixSet as an alternate to BloomFilter for safe-browsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Example of how a specific set would be stored. Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "base/task.h" 15 #include "base/task.h"
16 #include "chrome/browser/safe_browsing/safe_browsing_store.h" 16 #include "chrome/browser/safe_browsing/safe_browsing_store.h"
17 #include "testing/gtest/include/gtest/gtest_prod.h" 17 #include "testing/gtest/include/gtest/gtest_prod.h"
18 18
19 namespace base { 19 namespace base {
20 class Time; 20 class Time;
21 } 21 }
22 22
23 namespace safe_browsing {
24 class PrefixSet;
25 }
26
23 class BloomFilter; 27 class BloomFilter;
24 class GURL; 28 class GURL;
25 class MessageLoop; 29 class MessageLoop;
26 class SafeBrowsingDatabase; 30 class SafeBrowsingDatabase;
27 31
28 // Factory for creating SafeBrowsingDatabase. Tests implement this factory 32 // Factory for creating SafeBrowsingDatabase. Tests implement this factory
29 // to create fake Databases for testing. 33 // to create fake Databases for testing.
30 class SafeBrowsingDatabaseFactory { 34 class SafeBrowsingDatabaseFactory {
31 public: 35 public:
32 SafeBrowsingDatabaseFactory() { } 36 SafeBrowsingDatabaseFactory() { }
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // them every time. Cleared on next update. 269 // them every time. Cleared on next update.
266 std::set<SBPrefix> prefix_miss_cache_; 270 std::set<SBPrefix> prefix_miss_cache_;
267 271
268 // Used to schedule resetting the database because of corruption. 272 // Used to schedule resetting the database because of corruption.
269 ScopedRunnableMethodFactory<SafeBrowsingDatabaseNew> reset_factory_; 273 ScopedRunnableMethodFactory<SafeBrowsingDatabaseNew> reset_factory_;
270 274
271 // Set if corruption is detected during the course of an update. 275 // Set if corruption is detected during the course of an update.
272 // Causes the update functions to fail with no side effects, until 276 // Causes the update functions to fail with no side effects, until
273 // the next call to |UpdateStarted()|. 277 // the next call to |UpdateStarted()|.
274 bool corruption_detected_; 278 bool corruption_detected_;
279
280 // Used to check if a prefix was in the database.
281 scoped_ptr<safe_browsing::PrefixSet> prefix_set_;
275 }; 282 };
276 283
277 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_ 284 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/prefix_set_unittest.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