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

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

Issue 2160193003: PVer4: V4Database: Return stores that have a hash prefix for a given full hash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_check_url_store
Patch Set: incorporate nparker@ feedback Created 4 years, 5 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
« no previous file with comments | « components/safe_browsing_db/v4_database_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_STORE_H_ 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_ 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const std::string& state() const { return state_; } 162 const std::string& state() const { return state_; }
163 163
164 const base::FilePath& store_path() const { return store_path_; } 164 const base::FilePath& store_path() const { return store_path_; }
165 165
166 void ApplyUpdate(std::unique_ptr<ListUpdateResponse> response, 166 void ApplyUpdate(std::unique_ptr<ListUpdateResponse> response,
167 const scoped_refptr<base::SingleThreadTaskRunner>&, 167 const scoped_refptr<base::SingleThreadTaskRunner>&,
168 UpdatedStoreReadyCallback); 168 UpdatedStoreReadyCallback);
169 169
170 // If a hash prefix in this store matches |full_hash|, returns that hash 170 // If a hash prefix in this store matches |full_hash|, returns that hash
171 // prefix; otherwise returns an empty hash prefix. 171 // prefix; otherwise returns an empty hash prefix.
172 HashPrefix GetMatchingHashPrefix(const FullHash& full_hash); 172 virtual HashPrefix GetMatchingHashPrefix(const FullHash& full_hash);
173 173
174 std::string DebugString() const; 174 std::string DebugString() const;
175 175
176 // Reads the store file from disk and populates the in-memory representation 176 // Reads the store file from disk and populates the in-memory representation
177 // of the hash prefixes. 177 // of the hash prefixes.
178 void Initialize(); 178 void Initialize();
179 179
180 // Reset internal state and delete the backing file. 180 // Reset internal state and delete the backing file.
181 virtual bool Reset(); 181 virtual bool Reset();
182 182
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const base::FilePath store_path_; 301 const base::FilePath store_path_;
302 HashPrefixMap hash_prefix_map_; 302 HashPrefixMap hash_prefix_map_;
303 const scoped_refptr<base::SequencedTaskRunner> task_runner_; 303 const scoped_refptr<base::SequencedTaskRunner> task_runner_;
304 }; 304 };
305 305
306 std::ostream& operator<<(std::ostream& os, const V4Store& store); 306 std::ostream& operator<<(std::ostream& os, const V4Store& store);
307 307
308 } // namespace safe_browsing 308 } // namespace safe_browsing
309 309
310 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_ 310 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_
OLDNEW
« no previous file with comments | « components/safe_browsing_db/v4_database_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698