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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.h

Issue 11419041: Add tests for redirect responses from SafeBrowsingProtocolManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reintroduce newline Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/protocol_manager.h
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index 0d597ccb62aa487112988068da7bd492567cb4d0..d7f2e3a32132f1f8c05c3abc692a517f6b4d4d52 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -6,6 +6,9 @@
#define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_
// A class that implements Chrome's interface with the SafeBrowsing protocol.
+// See https://developers.google.com/safe-browsing/developers_guide_v2 for
+// protocol details.
+//
// The SafeBrowsingProtocolManager handles formatting and making requests of,
// and handling responses from, Google's SafeBrowsing servers. This class uses
// The SafeBrowsingProtocolParser class to do the actual parsing.
@@ -102,9 +105,6 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
void OnGetChunksComplete(const std::vector<SBListChunkRanges>& list,
bool database_error);
- // Called after the chunks that were parsed were inserted in the database.
- void OnChunkInserted();
-
// The last time we received an update.
base::Time last_update() const { return last_update_; }
@@ -237,6 +237,9 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// request. We use this to properly set our update state.
void UpdateResponseTimeout();
+ // Called after the chunks are added to the database.
+ void OnAddChunksComplete();
+
private:
// Map of GetHash requests to parameters which created it.
struct FullHashDetails {
@@ -356,6 +359,7 @@ class SafeBrowsingProtocolManagerDelegate {
public:
typedef base::Callback<void(const std::vector<SBListChunkRanges>&, bool)>
GetChunksCallback;
+ typedef base::Callback<void(void)> AddChunksCallback;
virtual ~SafeBrowsingProtocolManagerDelegate();
@@ -376,8 +380,10 @@ class SafeBrowsingProtocolManagerDelegate {
// may be made to GetChunks at a time.
virtual void GetChunks(GetChunksCallback callback) = 0;
- // Add new chunks to the database.
- virtual void AddChunks(const std::string& list, SBChunkList* chunks) = 0;
+ // Add new chunks to the database. Invokes |callback| when complete, but must
+ // call at a later time.
+ virtual void AddChunks(const std::string& list, SBChunkList* chunks,
+ AddChunksCallback callback) = 0;
// Delete chunks from the database.
virtual void DeleteChunks(
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/protocol_manager.cc » ('j') | chrome/browser/safe_browsing/protocol_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698