summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_database.h')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h
index d233ec6..b1712f0 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database.h
@@ -85,10 +85,14 @@ class SafeBrowsingDatabase {
base::Time last_update) = 0;
// Returns false if |url| is not in Download database. If it returns true,
- // |prefix_hits| should contain the prefix for |url|.
+ // |prefix_hit| should contain the prefix for |url|.
// This function could ONLY be accessed from creation thread.
virtual bool ContainsDownloadUrl(const GURL& url,
- std::vector<SBPrefix>* prefix_hits) = 0;
+ SBPrefix* prefix_hit) = 0;
+
+ // Returns false if |prefix| is not in Download database.
+ // This function could ONLY be accessed from creation thread.
+ virtual bool ContainsDownloadHashPrefix(const SBPrefix& prefix) = 0;
// A database transaction should look like:
//
@@ -188,8 +192,8 @@ class SafeBrowsingDatabaseNew : public SafeBrowsingDatabase {
std::vector<SBFullHashResult>* full_hits,
base::Time last_update);
virtual bool ContainsDownloadUrl(const GURL& url,
- std::vector<SBPrefix>* prefix_hits);
-
+ SBPrefix* prefix_hit);
+ virtual bool ContainsDownloadHashPrefix(const SBPrefix& prefix);
virtual bool UpdateStarted(std::vector<SBListChunkRanges>* lists);
virtual void InsertChunks(const std::string& list_name,
const SBChunkList& chunks);
@@ -233,6 +237,15 @@ class SafeBrowsingDatabaseNew : public SafeBrowsingDatabase {
void UpdateDownloadStore();
void UpdateBrowseStore();
+ // Helper function to compare addprefixes in download_store_ with prefix.
+ // The |list_bit| indicates which list (download url or download hash)
+ // to compare.
+ // Returns true if there is a match, |*prefix_hit| will contain the actual
+ // matching prefix.
+ bool MatchDownloadAddPrefixes(int list_bit,
+ const SBPrefix& prefix,
+ SBPrefix* prefix_hit);
+
// Used to verify that various calls are made from the thread the
// object was created on.
MessageLoop* creation_loop_;