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

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

Issue 18524: Merge r7710... (Closed) Base URL: svn://chrome-svn/chrome/branches/release_154.next/src/
Patch Set: Created 11 years, 11 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
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/safe_browsing/safe_browsing_database_bloom.h:r7710,7942,8290
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <queue> 10 #include <queue>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SUB_CHUNK = 1, 104 SUB_CHUNK = 1,
105 }; 105 };
106 106
107 // Checks if a chunk is in the database. 107 // Checks if a chunk is in the database.
108 bool ChunkExists(int list_id, ChunkType type, int chunk_id); 108 bool ChunkExists(int list_id, ChunkType type, int chunk_id);
109 109
110 // Return a comma separated list of chunk ids that are in the database for 110 // Return a comma separated list of chunk ids that are in the database for
111 // the given list and chunk type. 111 // the given list and chunk type.
112 void GetChunkIds(int list_id, ChunkType type, std::string* list); 112 void GetChunkIds(int list_id, ChunkType type, std::string* list);
113 113
114 // Converts between the SafeBrowsing list names and their enumerated value.
115 // If the list names change, both of these methods must be updated.
116 enum ListType {
117 MALWARE = 0,
118 PHISH = 1,
119 };
120 static int GetListId(const std::string& name);
121 static std::string GetListName(int list_id);
122
123 // Generate a bloom filter. 114 // Generate a bloom filter.
124 virtual void BuildBloomFilter(); 115 virtual void BuildBloomFilter();
125 116
126 // Helpers for building the bloom filter. 117 // Helpers for building the bloom filter.
127 typedef struct { 118 typedef struct {
128 int chunk_id; 119 int chunk_id;
129 SBPrefix prefix; 120 SBPrefix prefix;
130 } SBPair; 121 } SBPair;
131 122
132 static int PairCompare(const void* arg1, const void* arg2); 123 static int PairCompare(const void* arg1, const void* arg2);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Lock for protecting access to the bloom filter and hash cache. 248 // Lock for protecting access to the bloom filter and hash cache.
258 Lock lookup_lock_; 249 Lock lookup_lock_;
259 250
260 // A store for GetHash results that have not yet been written to the database. 251 // A store for GetHash results that have not yet been written to the database.
261 HashList pending_full_hashes_; 252 HashList pending_full_hashes_;
262 253
263 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseBloom); 254 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseBloom);
264 }; 255 };
265 256
266 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_ 257 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_DATABASE_BLOOM_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/protocol_parser_unittest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_database_bloom.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698