OLD | NEW |
1 // Copyright (c) 2012 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 // 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 #ifndef COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ | 49 #ifndef COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ |
50 #define COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ | 50 #define COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ |
51 | 51 |
52 #include <utility> | 52 #include <utility> |
53 #include <vector> | 53 #include <vector> |
54 | 54 |
55 #include "base/gtest_prod_util.h" | 55 #include "base/gtest_prod_util.h" |
56 #include "base/macros.h" | 56 #include "base/macros.h" |
57 #include "base/memory/scoped_ptr.h" | 57 #include "base/memory/scoped_ptr.h" |
58 #include "components/safe_browsing_db/safe_browsing_db_util.h" | 58 #include "components/safe_browsing_db/util.h" |
59 | 59 |
60 namespace base { | 60 namespace base { |
61 class FilePath; | 61 class FilePath; |
62 } | 62 } |
63 | 63 |
64 namespace safe_browsing { | 64 namespace safe_browsing { |
65 | 65 |
66 class PrefixSet { | 66 class PrefixSet { |
67 public: | 67 public: |
68 ~PrefixSet(); | 68 ~PrefixSet(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Buffers prefixes until enough are avaliable to emit a run. | 178 // Buffers prefixes until enough are avaliable to emit a run. |
179 std::vector<SBPrefix> buffer_; | 179 std::vector<SBPrefix> buffer_; |
180 | 180 |
181 // The PrefixSet being built. | 181 // The PrefixSet being built. |
182 scoped_ptr<PrefixSet> prefix_set_; | 182 scoped_ptr<PrefixSet> prefix_set_; |
183 }; | 183 }; |
184 | 184 |
185 } // namespace safe_browsing | 185 } // namespace safe_browsing |
186 | 186 |
187 #endif // COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ | 187 #endif // COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_ |
OLD | NEW |