Chromium Code Reviews| Index: components/offline_pages/background/request_coordinator.h |
| diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h |
| index 830d605e57819174e291103bb0f83ca8b3704ba9..1a2f99d3d3c9b15c7c13d1b5ae9205e5ef3f6b5d 100644 |
| --- a/components/offline_pages/background/request_coordinator.h |
| +++ b/components/offline_pages/background/request_coordinator.h |
| @@ -55,6 +55,11 @@ class RequestCoordinator : public KeyedService, |
| virtual void OnChanged(const SavePageRequest& request) = 0; |
| }; |
| + enum class RequestAvailability { |
| + AVAILABLE_TO_OFFLINER, |
| + DISABLED_TO_OFFLINER, |
| + }; |
| + |
| // Callback to report when a request was available. |
| typedef base::Callback<void(const SavePageRequest& request)> |
| RequestPickedCallback; |
| @@ -71,9 +76,11 @@ class RequestCoordinator : public KeyedService, |
| ~RequestCoordinator() override; |
| // Queues |request| to later load and save when system conditions allow. |
| - // Returns true if the page could be queued successfully. |
| - bool SavePageLater( |
| - const GURL& url, const ClientId& client_id, bool user_reqeusted); |
| + // Returns an id if the page could be queued successfully, 0L otherwise. |
| + int64_t SavePageLater(const GURL& url, |
| + const ClientId& client_id, |
| + bool user_reqeusted, |
|
Dmitry Titov
2016/10/05 22:28:19
typo: user_reqeusted -> user_requested
Pete Williamson
2016/10/05 22:57:46
Nice catch! Done.
|
| + RequestAvailability availability); |
|
Dmitry Titov
2016/10/05 22:28:19
I'd rather have a "bool do_not_process" or "bool b
Pete Williamson
2016/10/05 22:57:46
I think that FGorski had the opposite feedback in
|
| // Callback specifying which request IDs were actually removed. |
| typedef base::Callback<void( |
| @@ -111,6 +118,15 @@ class RequestCoordinator : public KeyedService, |
| // is stopped or complete. |
| void StopProcessing(Offliner::RequestStatus stop_status); |
| + // Used to denote that the foreground thread is ready for the offliner |
| + // to start work on a previously entered, but unavailable request. |
| + void MakeAvailableToOffliner(int64_t request_id); |
| + |
| + // If a request that is unavailable to the offliner is finished elsewhere, |
| + // (by the tab helper synchronous download), send a notificaiton that it |
| + // succeeded through our notificaiton system. |
| + void MarkRequestCompleted(int64_t request_id); |
| + |
| const Scheduler::TriggerConditions GetTriggerConditions( |
| const bool user_requested); |