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

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

Issue 8349018: Safe-browsing SBAddPrefix from vector to deque. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_store.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_store.h b/chrome/browser/safe_browsing/safe_browsing_store.h
index 9463b1ca6af86b0b85861752012853bb8065be3a..0966db7fcb79f2962e6276a5d0675dfc056b7196 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store.h
@@ -51,6 +51,8 @@ struct SBAddPrefix {
SBPrefix GetAddPrefix() const { return prefix; }
};
+typedef std::deque<SBAddPrefix> SBAddPrefixContainer;
+
struct SBSubPrefix {
int32 chunk_id;
int32 add_chunk_id;
@@ -138,7 +140,7 @@ bool SBAddPrefixHashLess(const T& a, const U& b) {
// TODO(shess): The original code did not process |sub_full_hashes|
// for matches in |add_full_hashes|, so this code doesn't, either. I
// think this is probably a bug.
-void SBProcessSubs(std::vector<SBAddPrefix>* add_prefixes,
+void SBProcessSubs(SBAddPrefixContainer* add_prefixes,
std::vector<SBSubPrefix>* sub_prefixes,
std::vector<SBAddFullHash>* add_full_hashes,
std::vector<SBSubFullHash>* sub_full_hashes,
@@ -147,7 +149,7 @@ void SBProcessSubs(std::vector<SBAddPrefix>* add_prefixes,
// Records a histogram of the number of items in |prefix_misses| which
// are not in |add_prefixes|.
-void SBCheckPrefixMisses(const std::vector<SBAddPrefix>& add_prefixes,
+void SBCheckPrefixMisses(const SBAddPrefixContainer& add_prefixes,
const std::set<SBPrefix>& prefix_misses);
// TODO(shess): This uses int32 rather than int because it's writing
@@ -174,7 +176,7 @@ class SafeBrowsingStore {
virtual bool Delete() = 0;
// Get all Add prefixes out from the store.
- virtual bool GetAddPrefixes(std::vector<SBAddPrefix>* add_prefixes) = 0;
+ virtual bool GetAddPrefixes(SBAddPrefixContainer* add_prefixes) = 0;
// Get all add full-length hashes.
virtual bool GetAddFullHashes(
@@ -230,7 +232,7 @@ class SafeBrowsingStore {
virtual bool FinishUpdate(
const std::vector<SBAddFullHash>& pending_adds,
const std::set<SBPrefix>& prefix_misses,
- std::vector<SBAddPrefix>* add_prefixes_result,
+ SBAddPrefixContainer* add_prefixes_result,
std::vector<SBAddFullHash>* add_full_hashes_result) = 0;
// Cancel the update in process and remove any temporary disk

Powered by Google App Engine
This is Rietveld 408576698