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

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

Issue 2403913004: Small: Serialize the store's hash_prefix_map_ to file in WriteToDisk() (Closed)
Patch Set: Serialize the store's hash_prefix_map_ to file in WriteToDisk() Created 4 years, 2 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_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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // Reads the state of the store from the file on disk and returns the reason 344 // Reads the state of the store from the file on disk and returns the reason
345 // for the failure or reports success. 345 // for the failure or reports success.
346 StoreReadResult ReadFromDisk(); 346 StoreReadResult ReadFromDisk();
347 347
348 // Updates the |additions_map| with the additions received in the partial 348 // Updates the |additions_map| with the additions received in the partial
349 // update from the server. 349 // update from the server.
350 ApplyUpdateResult UpdateHashPrefixMapFromAdditions( 350 ApplyUpdateResult UpdateHashPrefixMapFromAdditions(
351 const ::google::protobuf::RepeatedPtrField<ThreatEntrySet>& additions, 351 const ::google::protobuf::RepeatedPtrField<ThreatEntrySet>& additions,
352 HashPrefixMap* additions_map); 352 HashPrefixMap* additions_map);
353 353
354 // Writes the FULL_UPDATE |response| to disk as a V4StoreFileFormat proto. 354 // Writes the FULL_UPDATE |response| to disk as a V4StoreFileFormat proto.
Nathan Parker 2016/10/11 20:29:42 There's no longer a |response| arg
vakh (use Gerrit instead) 2016/10/11 21:50:39 Done.
355 StoreWriteResult WriteToDisk( 355 // |list_id| is used to set the (|platform_type|, |threat_entry_type|,
356 std::unique_ptr<ListUpdateResponse> response) const; 356 // threat_type|) fields, and |checksum| is used to set the |checksum| field in
357 // the final proto.
358 StoreWriteResult WriteToDisk(const ListIdentifier& list_id,
359 const Checksum& checksum) const;
357 360
358 // The checksum value as read from the disk, until it is verified. Once 361 // The checksum value as read from the disk, until it is verified. Once
359 // verified, it is cleared. 362 // verified, it is cleared.
360 std::string expected_checksum_; 363 std::string expected_checksum_;
361 364
362 // The state of the store as returned by the PVer4 server in the last applied 365 // The state of the store as returned by the PVer4 server in the last applied
363 // update response. 366 // update response.
364 std::string state_; 367 std::string state_;
365 const base::FilePath store_path_; 368 const base::FilePath store_path_;
366 HashPrefixMap hash_prefix_map_; 369 HashPrefixMap hash_prefix_map_;
367 const scoped_refptr<base::SequencedTaskRunner> task_runner_; 370 const scoped_refptr<base::SequencedTaskRunner> task_runner_;
368 }; 371 };
369 372
370 std::ostream& operator<<(std::ostream& os, const V4Store& store); 373 std::ostream& operator<<(std::ostream& os, const V4Store& store);
371 374
372 } // namespace safe_browsing 375 } // namespace safe_browsing
373 376
374 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_ 377 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_store.cc » ('j') | components/safe_browsing_db/v4_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698