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 7da1667c66f5012bd8949e5bfe8d1bc25e88323e..14ae93ead1fd0cb2264bd8e9745412edb0f29a30 100644 |
--- a/components/safe_browsing_db/v4_update_protocol_manager.h |
+++ b/components/safe_browsing_db/v4_update_protocol_manager.h |
@@ -87,6 +87,8 @@ class V4UpdateProtocolManager : public net::URLFetcherDelegate, |
TestGetUpdatesWithOneBackoff); |
FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
TestBase64EncodingUsesUrlEncoding); |
+ FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
+ TestGetUpdatesHasTimeout); |
friend class V4UpdateProtocolManagerFactoryImpl; |
// Fills a FetchThreatListUpdatesRequest protocol buffer for a request. |
@@ -111,6 +113,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); |
@@ -172,6 +178,9 @@ class V4UpdateProtocolManager : public net::URLFetcherDelegate, |
base::Time last_response_time_; |
+ // Used to interrupt and re-issue update requests that take too long. |
+ base::OneShotTimer timeout_timer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManager); |
}; |