| Index: components/safe_browsing_db/v4_store.h
|
| diff --git a/components/safe_browsing_db/v4_store.h b/components/safe_browsing_db/v4_store.h
|
| index 1939aea4c1a41c37994f372213e8ce34d2ad0584..b10a3c373dbef8f65827c4504ce3dde9bc13630c 100644
|
| --- a/components/safe_browsing_db/v4_store.h
|
| +++ b/components/safe_browsing_db/v4_store.h
|
| @@ -256,6 +256,7 @@ class V4Store {
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestMergeUpdatesFailsChecksum);
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestChecksumErrorOnStartup);
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest, WriteToDiskFails);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest, FullUpdateFailsChecksumSynchronously);
|
| friend class V4StoreTest;
|
|
|
| // If |prefix_size| is within expected range, and |raw_hashes_length| is a
|
| @@ -305,12 +306,14 @@ class V4Store {
|
| // The indices in the |raw_removals| list, which may be NULL, are not merged.
|
| // The SHA256 checksum of the final list of hash prefixes, in
|
| // lexicographically sorted order, must match |expected_checksum| (if it's not
|
| - // empty).
|
| - ApplyUpdateResult MergeUpdate(const HashPrefixMap& old_hash_prefix_map,
|
| - const HashPrefixMap& additions_map,
|
| - const ::google::protobuf::RepeatedField<
|
| - ::google::protobuf::int32>* raw_removals,
|
| - const std::string& expected_checksum);
|
| + // empty). Delays the checksum check if |delay_checksum_check| is true.
|
| + ApplyUpdateResult MergeUpdate(
|
| + const HashPrefixMap& old_hash_prefix_map,
|
| + const HashPrefixMap& additions_map,
|
| + const ::google::protobuf::RepeatedField<::google::protobuf::int32>*
|
| + raw_removals,
|
| + const std::string& expected_checksum,
|
| + bool delay_checksum_check);
|
|
|
| // Processes the FULL_UPDATE |response| from the server, and writes the
|
| // merged V4Store to disk. If processing the |response| succeeds, it returns
|
| @@ -322,9 +325,11 @@ class V4Store {
|
| // Processes a FULL_UPDATE |response| and updates the V4Store. If processing
|
| // the |response| succeeds, it returns APPLY_UPDATE_SUCCESS.
|
| // This method is called when we receive a FULL_UPDATE from the server, and
|
| - // when we read a store file from disk on startup.
|
| + // when we read a store file from disk on startup. Delays the checksum check
|
| + // if |delay_checksum_check| is true.
|
| ApplyUpdateResult ProcessFullUpdate(
|
| - const std::unique_ptr<ListUpdateResponse>& response);
|
| + const std::unique_ptr<ListUpdateResponse>& response,
|
| + bool delay_checksum_check);
|
|
|
| // Merges the hash prefixes in |hash_prefix_map_old| and |response|, updates
|
| // the |hash_prefix_map_| and |state_| in the V4Store, and writes the merged
|
| @@ -337,10 +342,12 @@ class V4Store {
|
|
|
| // Merges the hash prefixes in |hash_prefix_map_old| and |response|, and
|
| // updates the |hash_prefix_map_| and |state_| in the V4Store. If processing
|
| - // succeeds, it returns APPLY_UPDATE_SUCCESS.
|
| + // succeeds, it returns APPLY_UPDATE_SUCCESS. Delays the checksum check if
|
| + // |delay_checksum_check| is true.
|
| ApplyUpdateResult ProcessUpdate(
|
| const HashPrefixMap& hash_prefix_map_old,
|
| - const std::unique_ptr<ListUpdateResponse>& response);
|
| + const std::unique_ptr<ListUpdateResponse>& response,
|
| + bool delay_checksum_check);
|
|
|
| // Reads the state of the store from the file on disk and returns the reason
|
| // for the failure or reports success.
|
|
|