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 c757702b01bace4e290c725600225bb70b7e3e28..ac996cd932212371762176a03f4b359eec283b3e 100644 |
| --- a/components/offline_pages/background/request_coordinator.h |
| +++ b/components/offline_pages/background/request_coordinator.h |
| @@ -17,6 +17,7 @@ |
| #include "components/offline_pages/background/offliner.h" |
| #include "components/offline_pages/background/request_coordinator_event_logger.h" |
| #include "components/offline_pages/background/request_queue.h" |
| +#include "components/offline_pages/background/request_status.h" |
| #include "components/offline_pages/background/scheduler.h" |
| #include "url/gurl.h" |
| @@ -50,6 +51,17 @@ class RequestCoordinator : public KeyedService { |
| bool SavePageLater( |
| const GURL& url, const ClientId& client_id, bool user_reqeusted); |
| + // Callback that receives the response for GetRequestStatuses. Client must |
| + // copy the result right away, it goes out of scope at the end of the |
| + // callback. |
| + typedef base::Callback<void(const std::vector<RequestStatus>&)> |
| + RequestStatusCallback; |
| + |
| + // For a client namespace, get the status of all requests in the request queue |
| + // for that namespace. |
| + void GetRequestStatuses( |
| + std::string client_namespace, RequestStatusCallback callback); |
|
fgorski
2016/08/02 04:18:12
const&, const&
Pete Williamson
2016/08/03 00:24:32
Done.
|
| + |
| // Starts processing of one or more queued save page later requests. |
| // Returns whether processing was started and that caller should expect |
| // a callback. If processing was already active, returns false. |
| @@ -95,9 +107,19 @@ class RequestCoordinator : public KeyedService { |
| } |
| private: |
| + // Receives the results of a get from the request queue, and turns that into |
| + // RequestStatus objects for the caller of GetRequestStatuses. |
| + void GetRequestStatusesCallback( |
| + std::string client_namespace, |
|
fgorski
2016/08/02 04:18:12
const&
Pete Williamson
2016/08/03 00:24:31
Done.
|
| + RequestStatusCallback callback, |
| + RequestQueue::GetRequestsResult result, |
| + const std::vector<SavePageRequest>& requests); |
| + |
| + // Gets the result of add requests to the request queue. |
|
dougarnett
2016/08/02 20:39:28
Maybe match the previous doc style here and next o
Pete Williamson
2016/08/03 00:24:31
Done.
|
| void AddRequestResultCallback(RequestQueue::AddRequestResult result, |
| const SavePageRequest& request); |
| + // Gets the result of update and delete reqeusts to the request queue. |
|
dougarnett
2016/08/02 20:39:28
requests
Pete Williamson
2016/08/03 00:24:31
Done.
|
| void UpdateRequestCallback(RequestQueue::UpdateRequestResult result); |
| // Callback from the request picker when it has chosen our next request. |