| 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(
|
|
|