Index: components/safe_browsing_db/v4_update_protocol_manager.h |
diff --git a/components/safe_browsing_db/v4_update_protocol_manager.h b/components/safe_browsing_db/v4_update_protocol_manager.h |
index 318c47693757b864fcc4ea4a97b259ab687f9259..a3b4cd538e04f24944cbbd34fa9581c05cffc1f2 100644 |
--- a/components/safe_browsing_db/v4_update_protocol_manager.h |
+++ b/components/safe_browsing_db/v4_update_protocol_manager.h |
@@ -88,6 +88,8 @@ class V4UpdateProtocolManager : public net::URLFetcherDelegate, |
FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
TestBase64EncodingUsesUrlEncoding); |
FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, TestDisableAutoUpdates); |
+ FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
+ TestGetUpdatesHasTimeout); |
friend class V4UpdateProtocolManagerFactoryImpl; |
// Fills a FetchThreatListUpdatesRequest protocol buffer for a request. |
@@ -112,6 +114,10 @@ class V4UpdateProtocolManager : public net::URLFetcherDelegate, |
// Resets the update error counter and multiplier. |
void ResetUpdateErrors(); |
+ // Called when update request times out. Cancels the existing request and |
+ // re-sends the update request. |
+ void HandleTimeout(); |
+ |
// Updates internal update and backoff state for each update response error, |
// assuming that the current time is |now|. |
void HandleUpdateError(const base::Time& now); |
@@ -173,6 +179,10 @@ class V4UpdateProtocolManager : public net::URLFetcherDelegate, |
base::Time last_response_time_; |
+ // Used to interrupt and re-schedule update requests that take too long to |
+ // complete. |
+ base::OneShotTimer timeout_timer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManager); |
}; |