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

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

Issue 4588001: Cleanup converting safe-browsing chunks to range list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Lei comments. Created 10 years, 1 month 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/chunk_range.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/chunk_range.h
diff --git a/chrome/browser/safe_browsing/chunk_range.h b/chrome/browser/safe_browsing/chunk_range.h
index ace591fb8441d046f2eb515bc648060e904bb7c1..cc6d92fb5e16d9ba88014d342b861e2b3aec99de 100644
--- a/chrome/browser/safe_browsing/chunk_range.h
+++ b/chrome/browser/safe_browsing/chunk_range.h
@@ -42,25 +42,20 @@ class ChunkRange {
// Helper functions ------------------------------------------------------------
-// Convert a series of chunk numbers into a more compact range representation.
-// The 'chunks' vector must be sorted in ascending order.
-void ChunksToRanges(const std::vector<int>& chunks,
- std::vector<ChunkRange>* ranges);
-
// Convert a set of ranges into individual chunk numbers.
void RangesToChunks(const std::vector<ChunkRange>& ranges,
std::vector<int>* chunks);
-// Convert a series of chunk ranges into a string in protocol format.
-void RangesToString(const std::vector<ChunkRange>& ranges,
- std::string* result);
-
// Returns 'true' if the string was successfully converted to ChunkRanges,
// 'false' if the input was malformed.
// The string must be in the form: "1-100,398,415,1138-2001,2019".
bool StringToRanges(const std::string& input,
std::vector<ChunkRange>* ranges);
+// Convenience for going from a list of chunks to a string in protocol
+// format.
+void ChunksToRangeString(const std::vector<int>& chunks, std::string* result);
+
// Tests if a chunk number is contained a sorted vector of ChunkRanges.
bool IsChunkInRange(int chunk_number, const std::vector<ChunkRange>& ranges);
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/chunk_range.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698