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

Side by Side Diff: chrome/browser/safe_browsing/prefix_set.h

Issue 263833005: Knock out injected safe-browsing prefixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: additional color on the histogram. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, IntMinMax); 84 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, IntMinMax);
85 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, OneElement); 85 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, OneElement);
86 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWrite); 86 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWrite);
87 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWriteSigned); 87 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWriteSigned);
88 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, Version3); 88 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, Version3);
89 89
90 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, BasicStore); 90 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, BasicStore);
91 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DeleteChunks); 91 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DeleteChunks);
92 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DetectsCorruption); 92 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DetectsCorruption);
93 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Empty); 93 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Empty);
94 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, KnockoutPrefixVolunteers);
94 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, PrefixMinMax); 95 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, PrefixMinMax);
95 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, SubKnockout); 96 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, SubKnockout);
96 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version7); 97 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version7);
97 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version8); 98 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version8);
98 99
99 // Maximum number of consecutive deltas to encode before generating 100 // Maximum number of consecutive deltas to encode before generating
100 // a new index entry. This helps keep the worst-case performance 101 // a new index entry. This helps keep the worst-case performance
101 // for |Exists()| under control. 102 // for |Exists()| under control.
102 static const size_t kMaxRun = 100; 103 static const size_t kMaxRun = 100;
103 104
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Buffers prefixes until enough are avaliable to emit a run. 175 // Buffers prefixes until enough are avaliable to emit a run.
175 std::vector<SBPrefix> buffer_; 176 std::vector<SBPrefix> buffer_;
176 177
177 // The PrefixSet being built. 178 // The PrefixSet being built.
178 scoped_ptr<PrefixSet> prefix_set_; 179 scoped_ptr<PrefixSet> prefix_set_;
179 }; 180 };
180 181
181 } // namespace safe_browsing 182 } // namespace safe_browsing
182 183
183 #endif // CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ 184 #endif // CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698