Home | History | Annotate | Download | only in safe_browsing

Lines Matching refs:prefixes

103 // Constructs a bloom filter of the appropriate size from the provided prefixes.
105 const std::vector<SBPrefix>& prefixes,
108 const int key_count = std::max(static_cast<int>(prefixes.size()),
113 // Add the prefixes to it.
114 for (size_t i = 0; i < prefixes.size(); ++i)
115 (*bloom_filter)->Insert(prefixes[i]);
117 std::cout << "Bloom filter with prefixes: " << prefixes.size()
123 // Reads the set of add prefixes contained in a SafeBrowsing database into a
126 bool ReadDatabase(const FilePath& path, std::vector<SBPrefix>* prefixes) {
144 prefixes->reserve(count);
151 prefixes->push_back(prefix_statement.ColumnInt(0));
153 DCHECK(static_cast<int>(prefixes->size()) == count);
154 sort(prefixes->begin(), prefixes->end());
159 // Generates all legal SafeBrowsing prefixes for the specified URL, and returns
160 // the set of Prefixes that exist in the bloom filter. The function returns the
164 std::vector<SBPrefix>* prefixes) {
181 prefixes->push_back(prefix);
188 // Binary search of sorted prefixes.
190 const std::vector<SBPrefix>& prefixes) {
191 if (prefixes.empty())
195 int high = prefixes.size() - 1;
198 SBPrefix prefix_mid = prefixes[mid];
210 // Construct a bloom filter with the given prefixes and multiplier, and test the
251 std::vector<SBPrefix> prefixes;
252 prefix_count += GeneratePrefixHits(url, bloom_filter, &prefixes);
255 for (size_t i = 0; i < prefixes.size(); ++i) {
256 if (IsPrefixInDatabase(prefixes[i], prefix_list)) {
261 << " (prefix = " << prefixes[i] << ")"
269 << " (prefix = " << prefixes[i] << ")"
341 // Check a large number of random prefixes against the filter.
356 << ", prefixes: " << prefix_list.size()