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

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

Issue 220493003: Safebrowsing: change gethash caching to match api 2.3 rules, fix some corner cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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
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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_
7 7
8 // A class that implements Chrome's interface with the SafeBrowsing protocol. 8 // A class that implements Chrome's interface with the SafeBrowsing protocol.
9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for 9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for
10 // protocol details. 10 // protocol details.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 class SBProtocolManagerFactory; 52 class SBProtocolManagerFactory;
53 class SafeBrowsingProtocolManagerDelegate; 53 class SafeBrowsingProtocolManagerDelegate;
54 54
55 class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, 55 class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
56 public base::NonThreadSafe { 56 public base::NonThreadSafe {
57 public: 57 public:
58 // FullHashCallback is invoked when GetFullHash completes. 58 // FullHashCallback is invoked when GetFullHash completes.
59 // Parameters: 59 // Parameters:
60 // - The vector of full hash results. If empty, indicates that there 60 // - The vector of full hash results. If empty, indicates that there
61 // were no matches, and that the resource is safe. 61 // were no matches, and that the resource is safe.
62 // - Whether the result can be cached. This may not be the case when 62 // - The cache lifetime of the result. A lifetime of 0 indicates the results
63 // the result did not come from the SB server, for example. 63 // should not be cached.
64 typedef base::Callback<void(const std::vector<SBFullHashResult>&, 64 typedef base::Callback<void(const std::vector<SBFullHashResult>&,
65 bool)> FullHashCallback; 65 const base::TimeDelta&)> FullHashCallback;
66 66
67 virtual ~SafeBrowsingProtocolManager(); 67 virtual ~SafeBrowsingProtocolManager();
68 68
69 // Makes the passed |factory| the factory used to instantiate 69 // Makes the passed |factory| the factory used to instantiate
70 // a SafeBrowsingService. Useful for tests. 70 // a SafeBrowsingService. Useful for tests.
71 static void RegisterFactory(SBProtocolManagerFactory* factory) { 71 static void RegisterFactory(SBProtocolManagerFactory* factory) {
72 factory_ = factory; 72 factory_ = factory;
73 } 73 }
74 74
75 // Create an instance of the safe browsing protocol manager. 75 // Create an instance of the safe browsing protocol manager.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // call at a later time. 423 // call at a later time.
424 virtual void AddChunks(const std::string& list, SBChunkList* chunks, 424 virtual void AddChunks(const std::string& list, SBChunkList* chunks,
425 AddChunksCallback callback) = 0; 425 AddChunksCallback callback) = 0;
426 426
427 // Delete chunks from the database. 427 // Delete chunks from the database.
428 virtual void DeleteChunks( 428 virtual void DeleteChunks(
429 std::vector<SBChunkDelete>* delete_chunks) = 0; 429 std::vector<SBChunkDelete>* delete_chunks) = 0;
430 }; 430 };
431 431
432 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ 432 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698