OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Class for parsing lists of integers into ranges. | 5 // Class for parsing lists of integers into ranges. |
6 // | 6 // |
7 // The anti-phishing and anti-malware protocol sends ASCII strings of numbers | 7 // The anti-phishing and anti-malware protocol sends ASCII strings of numbers |
8 // and ranges of numbers corresponding to chunks of whitelists and blacklists. | 8 // and ranges of numbers corresponding to chunks of whitelists and blacklists. |
9 // Clients of this protocol need to be able to convert back and forth between | 9 // Clients of this protocol need to be able to convert back and forth between |
10 // this representation, and individual integer chunk numbers. The ChunkRange | 10 // this representation, and individual integer chunk numbers. The ChunkRange |
11 // class is a simple and compact mechanism for storing a continuous list of | 11 // class is a simple and compact mechanism for storing a continuous list of |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 std::vector<ChunkRange>* ranges); | 52 std::vector<ChunkRange>* ranges); |
53 | 53 |
54 // Convenience for going from a list of chunks to a string in protocol | 54 // Convenience for going from a list of chunks to a string in protocol |
55 // format. | 55 // format. |
56 void ChunksToRangeString(const std::vector<int>& chunks, std::string* result); | 56 void ChunksToRangeString(const std::vector<int>& chunks, std::string* result); |
57 | 57 |
58 // Tests if a chunk number is contained a sorted vector of ChunkRanges. | 58 // Tests if a chunk number is contained a sorted vector of ChunkRanges. |
59 bool IsChunkInRange(int chunk_number, const std::vector<ChunkRange>& ranges); | 59 bool IsChunkInRange(int chunk_number, const std::vector<ChunkRange>& ranges); |
60 | 60 |
61 #endif // CHROME_BROWSER_SAFE_BROWSING_CHUNK_RANGE_H_ | 61 #endif // CHROME_BROWSER_SAFE_BROWSING_CHUNK_RANGE_H_ |
OLD | NEW |