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

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

Issue 2219393004: Adds an observer for the request coordinator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resumeAPI
Patch Set: Fix nits. 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
Index: components/offline_pages/background/request_queue_store.h
diff --git a/components/offline_pages/background/request_queue_store.h b/components/offline_pages/background/request_queue_store.h
index c9b0af9dc040aa8274e735cbf508fad0c78c2fa7..9622efd2206c11b457b51385c2b70356c8dba2a5 100644
--- a/components/offline_pages/background/request_queue_store.h
+++ b/components/offline_pages/background/request_queue_store.h
@@ -23,16 +23,21 @@ class RequestQueueStore {
UPDATED, // Request was updated successfully.
FAILED, // Add or update attempt failed.
};
- // TODO(petewil): What if no items were updated? Maybe this should work more
- // like DeleteCallback, passing pairs of request_id and status.
typedef base::Callback<void(
bool /* success */,
const std::vector<SavePageRequest>& /* requests */)>
GetRequestsCallback;
typedef base::Callback<void(UpdateStatus)> UpdateCallback;
+ // TODO(petewil) - UpdateMultiple looks exactly like Remove, consider
+ // merging them into a single callback.
typedef base::Callback<void(
- const RequestQueue::UpdateMultipleRequestResults&)>
+ const RequestQueue::UpdateMultipleRequestResults& /* statuses*/,
+ const std::vector<SavePageRequest>& /* requests */)>
+ UpdateMultipleRequestsCallback;
+ typedef base::Callback<void(
+ const RequestQueue::UpdateMultipleRequestResults& /* statuses */,
+ const std::vector<SavePageRequest>& /* requests */)>
RemoveCallback;
typedef base::Callback<void(bool /* success */)> ResetCallback;
@@ -59,7 +64,7 @@ class RequestQueueStore {
virtual void ChangeRequestsState(
const std::vector<int64_t>& request_ids,
const SavePageRequest::RequestState new_state,
- const UpdateCallback& callback) = 0;
+ const UpdateMultipleRequestsCallback& callback) = 0;
// Resets the store.
virtual void Reset(const ResetCallback& callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698