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

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: Resolve merge conflicts 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
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 242
241 // Called on the IO thread wheh the SafeBrowsingProtocolManager has received 243 // Called on the IO thread wheh the SafeBrowsingProtocolManager has received
242 // the full hash and api results for prefixes of the |url| argument in 244 // the full hash and api results for prefixes of the |url| argument in
243 // CheckApiBlacklistUrl. 245 // CheckApiBlacklistUrl.
244 virtual void HandleGetHashesWithApisResults( 246 virtual void HandleGetHashesWithApisResults(
245 SafeBrowsingApiCheck* check, 247 SafeBrowsingApiCheck* check,
246 const std::vector<SBFullHashResult>& full_hash_results, 248 const std::vector<SBFullHashResult>& full_hash_results,
(...skipping 23 matching lines...) Expand all
270 V4GetHashProtocolManager* v4_get_hash_protocol_manager_; 272 V4GetHashProtocolManager* v4_get_hash_protocol_manager_;
271 273
272 private: 274 private:
273 // Returns an iterator to the pending API check with the given |client|. 275 // Returns an iterator to the pending API check with the given |client|.
274 ApiCheckSet::iterator FindClientApiCheck(Client* client); 276 ApiCheckSet::iterator FindClientApiCheck(Client* client);
275 }; // class SafeBrowsingDatabaseManager 277 }; // class SafeBrowsingDatabaseManager
276 278
277 } // namespace safe_browsing 279 } // namespace safe_browsing
278 280
279 #endif // COMPONENTS_SAFE_BROWSING_DB_DATABASE_MANAGER_H_ 281 #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') | components/safe_browsing_db/database_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698