Index: components/web_resource/web_resource_service.h |
diff --git a/components/web_resource/web_resource_service.h b/components/web_resource/web_resource_service.h |
index 1c1103ab9510d51eca7d2c52a262903e4c5c0b4e..3f37ddc360355565c170e1c0d1594d4eda7e4583 100644 |
--- a/components/web_resource/web_resource_service.h |
+++ b/components/web_resource/web_resource_service.h |
@@ -64,10 +64,17 @@ class WebResourceService |
// Then begin updating resources. |
void StartAfterDelay(); |
+ // Sets the ResourceRequestAllowedNotifier to make it configurable. |
+ void SetResourceRequestAllowedNotifier( |
+ std::unique_ptr<ResourceRequestAllowedNotifier> notifier); |
+ |
protected: |
PrefService* prefs_; |
+ bool GetFetchScheduled() const; |
private: |
+ friend class WebResourceServiceTest; |
+ |
// For the subclasses to process the result of a fetch. |
virtual void Unpack(const base::DictionaryValue& parsed_json) = 0; |
@@ -92,7 +99,14 @@ class WebResourceService |
// Helper class used to tell this service if it's allowed to make network |
// resource requests. |
- ResourceRequestAllowedNotifier resource_request_allowed_notifier_; |
+ std::unique_ptr<ResourceRequestAllowedNotifier> |
+ resource_request_allowed_notifier_; |
+ |
+ // True if we have scheduled a fetch after start_fetch_delay_ms_ |
+ // or another one in |cache_update_delay_ms_| time. Set to false |
+ // before fetching starts so that next fetch is scheduled. This is |
Dan Beam
2016/08/19 02:14:32
nit: wrap to 80 character lines
guptaag
2017/03/01 21:52:24
On 2016/08/19 02:14:32, Dan Beam wrote:
> nit: wra
|
+ // to make sure not more than one fetch is scheduled for given point in time. |
+ bool fetch_scheduled_; |
// The tool that fetches the url data from the server. |
std::unique_ptr<net::URLFetcher> url_fetcher_; |