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

Side by Side Diff: components/safe_browsing_db/v4_database.h

Issue 2225613002: V4LDM: Add check for HashPrefix match and some tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move declaration of stores_to_look close to site of use. Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // and calls the db_updated_callback when done. 74 // and calls the db_updated_callback when done.
75 void ApplyUpdate(std::unique_ptr<ParsedServerResponse> parsed_server_response, 75 void ApplyUpdate(std::unique_ptr<ParsedServerResponse> parsed_server_response,
76 DatabaseUpdatedCallback db_updated_callback); 76 DatabaseUpdatedCallback db_updated_callback);
77 77
78 // Returns the current state of each of the stores being managed. 78 // Returns the current state of each of the stores being managed.
79 std::unique_ptr<StoreStateMap> GetStoreStateMap(); 79 std::unique_ptr<StoreStateMap> GetStoreStateMap();
80 80
81 // Searches for a hash prefix matching the |full_hash| in stores in the 81 // Searches for a hash prefix matching the |full_hash| in stores in the
82 // database, filtered by |stores_to_look|, and returns the identifier of the 82 // database, filtered by |stores_to_look|, and returns the identifier of the
83 // store along with the matching hash prefix in |matched_hash_prefix_map|. 83 // store along with the matching hash prefix in |matched_hash_prefix_map|.
84 void GetStoresMatchingFullHash( 84 virtual void GetStoresMatchingFullHash(
85 const FullHash& full_hash, 85 const FullHash& full_hash,
86 const base::hash_set<UpdateListIdentifier>& stores_to_look, 86 const base::hash_set<UpdateListIdentifier>& stores_to_look,
87 MatchedHashPrefixMap* matched_hash_prefix_map); 87 MatchedHashPrefixMap* matched_hash_prefix_map);
88 88
89 // Deletes the current database and creates a new one. 89 // Deletes the current database and creates a new one.
90 virtual bool ResetDatabase(); 90 virtual bool ResetDatabase();
91 91
92 protected: 92 protected:
93 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 93 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
94 std::unique_ptr<StoreMap> store_map); 94 std::unique_ptr<StoreMap> store_map);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // that needed updating and is ready for the next update. It should only be 140 // that needed updating and is ready for the next update. It should only be
141 // accessed on the IO thread. 141 // accessed on the IO thread.
142 int pending_store_updates_; 142 int pending_store_updates_;
143 143
144 DISALLOW_COPY_AND_ASSIGN(V4Database); 144 DISALLOW_COPY_AND_ASSIGN(V4Database);
145 }; 145 };
146 146
147 } // namespace safe_browsing 147 } // namespace safe_browsing
148 148
149 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ 149 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_
OLDNEW
« no previous file with comments | « components/safe_browsing_db/BUILD.gn ('k') | components/safe_browsing_db/v4_local_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698