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

Unified Diff: chrome/browser/safe_browsing/prefix_set.h

Issue 781613002: Make SafeBrowsingDatabase's PrefixSets only updatable by swapping a new one in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_threadchecks
Patch Set: rebase off of CL 744183002 Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/prefix_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/prefix_set.h
diff --git a/chrome/browser/safe_browsing/prefix_set.h b/chrome/browser/safe_browsing/prefix_set.h
index c0937268b5312078132a2736ec40d9f2169b1a34..6efd21973ffbd5928a729755feef40059bc8e603 100644
--- a/chrome/browser/safe_browsing/prefix_set.h
+++ b/chrome/browser/safe_browsing/prefix_set.h
@@ -71,7 +71,8 @@ class PrefixSet {
bool Exists(const SBFullHash& hash) const;
// Persist the set on disk.
- static scoped_ptr<PrefixSet> LoadFile(const base::FilePath& filter_name);
+ static scoped_ptr<const PrefixSet> LoadFile(
+ const base::FilePath& filter_name);
bool WriteFile(const base::FilePath& filter_name) const;
private:
@@ -161,11 +162,12 @@ class PrefixSetBuilder {
// Flush any buffered prefixes, and return the final PrefixSet instance.
// |hashes| are sorted and stored in |full_hashes_|. Any call other than the
// destructor is illegal after this call.
- scoped_ptr<PrefixSet> GetPrefixSet(const std::vector<SBFullHash>& hashes);
+ scoped_ptr<const PrefixSet> GetPrefixSet(
+ const std::vector<SBFullHash>& hashes);
// Helper for clients which only track prefixes. Calls GetPrefixSet() with
// empty hash vector.
- scoped_ptr<PrefixSet> GetPrefixSetNoHashes();
+ scoped_ptr<const PrefixSet> GetPrefixSetNoHashes();
private:
// Encode a run of deltas for |AddRun()|. The run is broken by a too-large
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/prefix_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698