OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A read-only set implementation for |SBPrefix| items. Prefixes are | 5 // A read-only set implementation for |SBPrefix| items. Prefixes are |
6 // sorted and stored as 16-bit deltas from the previous prefix. An | 6 // sorted and stored as 16-bit deltas from the previous prefix. An |
7 // index structure provides quick random access, and also handles | 7 // index structure provides quick random access, and also handles |
8 // cases where 16 bits cannot encode a delta. | 8 // cases where 16 bits cannot encode a delta. |
9 // | 9 // |
10 // For example, the sequence {20, 25, 41, 65432, 150000, 160000} would | 10 // For example, the sequence {20, 25, 41, 65432, 150000, 160000} would |
(...skipping 30 matching lines...) Expand all Loading... |
41 // 4 byte magic number | 41 // 4 byte magic number |
42 // 4 byte version number | 42 // 4 byte version number |
43 // 4 byte |index_.size()| | 43 // 4 byte |index_.size()| |
44 // 4 byte |deltas_.size()| | 44 // 4 byte |deltas_.size()| |
45 // n * 8 byte |&index_[0]..&index_[n]| | 45 // n * 8 byte |&index_[0]..&index_[n]| |
46 // m * 2 byte |&deltas_[0]..&deltas_[m]| | 46 // m * 2 byte |&deltas_[0]..&deltas_[m]| |
47 // 16 byte digest | 47 // 16 byte digest |
48 | 48 |
49 #ifndef CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ | 49 #ifndef CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ |
50 #define CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ | 50 #define CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ |
51 #pragma once | |
52 | 51 |
53 #include <vector> | 52 #include <vector> |
54 | 53 |
55 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 54 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
56 | 55 |
57 class FilePath; | 56 class FilePath; |
58 | 57 |
59 namespace safe_browsing { | 58 namespace safe_browsing { |
60 | 59 |
61 class PrefixSet { | 60 class PrefixSet { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // changed after generation during construction. |checksum_| is | 119 // changed after generation during construction. |checksum_| is |
121 // calculated from the data used to construct those vectors. | 120 // calculated from the data used to construct those vectors. |
122 uint32 checksum_; | 121 uint32 checksum_; |
123 | 122 |
124 DISALLOW_COPY_AND_ASSIGN(PrefixSet); | 123 DISALLOW_COPY_AND_ASSIGN(PrefixSet); |
125 }; | 124 }; |
126 | 125 |
127 } // namespace safe_browsing | 126 } // namespace safe_browsing |
128 | 127 |
129 #endif // CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ | 128 #endif // CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ |
OLD | NEW |