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

Side by Side Diff: components/safe_browsing_db/database_manager.h

Issue 2009133005: SafeBrowsing: Implement cache eviction for API full hash results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@osb-cache
Patch Set: Rebase Created 4 years, 6 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 | components/safe_browsing_db/database_manager.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 // The Safe Browsing service is responsible for downloading anti-phishing and 5 // The Safe Browsing service is responsible for downloading anti-phishing and
6 // anti-malware tables and checking urls against them. 6 // anti-malware tables and checking urls against them.
7 7
8 #ifndef COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 8 #ifndef COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
9 #define COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 9 #define COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 227 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
228 CancelApiCheck); 228 CancelApiCheck);
229 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 229 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
230 ResultsAreCached); 230 ResultsAreCached);
231 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 231 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
232 ResultsAreNotCachedOnNull); 232 ResultsAreNotCachedOnNull);
233 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 233 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
234 GetCachedResults); 234 GetCachedResults);
235 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest, 235 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
236 CachedResultsMerged); 236 CachedResultsMerged);
237 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingDatabaseManagerTest,
238 CachedResultsAreEvicted);
237 239
238 typedef std::set<SafeBrowsingApiCheck*> ApiCheckSet; 240 typedef std::set<SafeBrowsingApiCheck*> ApiCheckSet;
239 typedef std::map<SBPrefix, SBCachedFullHashResult> PrefixToFullHashResultsMap; 241 typedef std::map<SBPrefix, SBCachedFullHashResult> PrefixToFullHashResultsMap;
240 typedef std::map<SBThreatType, PrefixToFullHashResultsMap> 242 typedef std::map<SBThreatType, PrefixToFullHashResultsMap>
241 ThreatTypeToResultsMap; 243 ThreatTypeToResultsMap;
242 244
243 // Called on the IO thread wheh the SafeBrowsingProtocolManager has received 245 // Called on the IO thread wheh the SafeBrowsingProtocolManager has received
244 // the full hash and api results for prefixes of the |url| argument in 246 // the full hash and api results for prefixes of the |url| argument in
245 // CheckApiBlacklistUrl. 247 // CheckApiBlacklistUrl.
246 virtual void HandleGetHashesWithApisResults( 248 virtual void HandleGetHashesWithApisResults(
(...skipping 29 matching lines...) Expand all
276 V4GetHashProtocolManager* v4_get_hash_protocol_manager_; 278 V4GetHashProtocolManager* v4_get_hash_protocol_manager_;
277 279
278 private: 280 private:
279 // Returns an iterator to the pending API check with the given |client|. 281 // Returns an iterator to the pending API check with the given |client|.
280 ApiCheckSet::iterator FindClientApiCheck(Client* client); 282 ApiCheckSet::iterator FindClientApiCheck(Client* client);
281 }; // class SafeBrowsingDatabaseManager 283 }; // class SafeBrowsingDatabaseManager
282 284
283 } // namespace safe_browsing 285 } // namespace safe_browsing
284 286
285 #endif // COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 287 #endif // COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698