| 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 c4bf355f7e5e3f784483b96d636c87d093165daa..f65c3d47b4f2ffd25f4cd1970e33c42779846a50 100644
|
| --- a/components/safe_browsing_db/v4_store.h
|
| +++ b/components/safe_browsing_db/v4_store.h
|
| @@ -128,6 +128,10 @@ enum ApplyUpdateResult {
|
| // The server sent a response_type that the client did not expect.
|
| UNEXPECTED_RESPONSE_TYPE_FAILURE = 6,
|
|
|
| + // One of more index(es) in removals field of the response is greater than
|
| + // the number of hash prefixes currently in the (old) store.
|
| + REMOVALS_INDEX_TOO_LARGE = 7,
|
| +
|
| // Memory space for histograms is determined by the max. ALWAYS
|
| // ADD NEW VALUES BEFORE THIS ONE.
|
| APPLY_UPDATE_RESULT_MAX
|
| @@ -197,6 +201,16 @@ class V4Store {
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| TestMergeUpdatesFailsForRepeatedHashPrefix);
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| + TestMergeUpdatesFailsWhenRemovalsIndexTooLarge);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestMergeUpdatesRemovesOnlyElement);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestMergeUpdatesRemovesFirstElement);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestMergeUpdatesRemovesMiddleElement);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest, TestMergeUpdatesRemovesLastElement);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| + TestMergeUpdatesRemovesWhenOldHasDifferentSizes);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| + TestMergeUpdatesRemovesMultipleAcrossDifferentSizes);
|
| + FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| TestReadFullResponseWithValidHashPrefixMap);
|
| FRIEND_TEST_ALL_PREFIXES(V4StoreTest,
|
| TestReadFullResponseWithInvalidHashPrefixMap);
|
| @@ -240,7 +254,9 @@ class V4Store {
|
| // update (additions_map) to populate the prefix map for the current store.
|
| // TODO(vakh): Process removals also.
|
| ApplyUpdateResult MergeUpdate(const HashPrefixMap& old_hash_prefix_map,
|
| - const HashPrefixMap& additions_map);
|
| + const HashPrefixMap& additions_map,
|
| + const ::google::protobuf::RepeatedField<
|
| + ::google::protobuf::int32>& raw_removals);
|
|
|
| // Reads the state of the store from the file on disk and returns the reason
|
| // for the failure or reports success.
|
|
|