OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |