Chromium Code Reviews| 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..49514d935a72ca1201748e4522dcbc9e8d29d93b 100644 |
| --- a/components/web_resource/web_resource_service.h |
| +++ b/components/web_resource/web_resource_service.h |
| @@ -64,10 +64,16 @@ class WebResourceService |
| // Then begin updating resources. |
| void StartAfterDelay(); |
| + // Sets the ResourceRequestAllowedNotifier to make it configurable. |
| + void SetResourceRequestAllowedNotifier( |
| + std::unique_ptr<ResourceRequestAllowedNotifier> notifier); |
|
Dan Beam
2016/08/08 18:15:33
4\s indent instead of 2\s (add 2 more spaces to th
|
| + |
| protected: |
| PrefService* prefs_; |
| 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 +98,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 |
| + // 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_; |