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

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

Issue 507653003: Remove safe-browsing code to fix up injected prefixes. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert original CL more thoroughly. Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_store.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, IntMinMax); 85 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, IntMinMax);
86 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, OneElement); 86 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, OneElement);
87 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWrite); 87 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWrite);
88 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWriteSigned); 88 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, ReadWriteSigned);
89 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, Version3); 89 FRIEND_TEST_ALL_PREFIXES(PrefixSetTest, Version3);
90 90
91 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, BasicStore); 91 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, BasicStore);
92 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DeleteChunks); 92 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DeleteChunks);
93 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DetectsCorruption); 93 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, DetectsCorruption);
94 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Empty); 94 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Empty);
95 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, KnockoutPrefixVolunteers);
96 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, PrefixMinMax); 95 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, PrefixMinMax);
97 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, SubKnockout); 96 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, SubKnockout);
98 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version7); 97 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version7);
99 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version8); 98 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingStoreFileTest, Version8);
100 99
101 // Maximum number of consecutive deltas to encode before generating 100 // Maximum number of consecutive deltas to encode before generating
102 // a new index entry. This helps keep the worst-case performance 101 // a new index entry. This helps keep the worst-case performance
103 // for |Exists()| under control. 102 // for |Exists()| under control.
104 static const size_t kMaxRun = 100; 103 static const size_t kMaxRun = 100;
105 104
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Buffers prefixes until enough are avaliable to emit a run. 175 // Buffers prefixes until enough are avaliable to emit a run.
177 std::vector<SBPrefix> buffer_; 176 std::vector<SBPrefix> buffer_;
178 177
179 // The PrefixSet being built. 178 // The PrefixSet being built.
180 scoped_ptr<PrefixSet> prefix_set_; 179 scoped_ptr<PrefixSet> prefix_set_;
181 }; 180 };
182 181
183 } // namespace safe_browsing 182 } // namespace safe_browsing
184 183
185 #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_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698