Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: components/offline_pages/background/request_coordinator.h

Issue 2202113002: API to provide status of save page reqeusts to API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up naming Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24c2183a34de46243d3ccd1c2ca418580abd7636..1be339301b6765ada546094001045efdb32b9210 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -55,6 +55,17 @@ class RequestCoordinator : public KeyedService {
// TODO(petewil): Add code to cancel an in-progress pre-render.
void RemoveRequests(const std::vector<ClientId>& client_ids);
+ // Callback that receives the response for GetQueuedRequests. 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<ClientId>&)>
+ QueuedRequestCallback;
+
+ // For a client namespace, get the ClientId of all requests for that
+ // namespace.
+ void GetQueuedRequests(const std::string& client_namespace,
+ const QueuedRequestCallback& callback);
+
// 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.
@@ -100,9 +111,18 @@ class RequestCoordinator : public KeyedService {
}
private:
+ // Receives the results of a get from the request queue, and turns that into
+ // ClientId objects for the caller of GetQueuedRequests.
+ void GetQueuedRequestsCallback(const std::string& client_namespace,
+ const QueuedRequestCallback& callback,
+ RequestQueue::GetRequestsResult result,
+ const std::vector<SavePageRequest>& requests);
+
+ // Receives the result of add requests to the request queue.
void AddRequestResultCallback(RequestQueue::AddRequestResult result,
const SavePageRequest& request);
+ // Receives the result of update and delete requests to the request queue.
void UpdateRequestCallback(RequestQueue::UpdateRequestResult result);
// Callback from the request picker when it has chosen our next request.
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698