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

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

Issue 2221323003: Add an API to Pause and Resume background offlining requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test break introduced by merge 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 2cc17e8c24d7aec76fc614223999e3cf2305e5b4..c9b0af9dc040aa8274e735cbf508fad0c78c2fa7 100644
--- a/components/offline_pages/background/request_queue_store.h
+++ b/components/offline_pages/background/request_queue_store.h
@@ -10,11 +10,11 @@
#include "base/callback.h"
#include "components/offline_pages/background/request_queue.h"
+#include "components/offline_pages/background/save_page_request.h"
+#include "components/offline_pages/offline_page_item.h"
namespace offline_pages {
-class SavePageRequest;
-
// Interface for classes storing save page requests.
class RequestQueueStore {
public:
@@ -23,6 +23,8 @@ 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 */,
@@ -52,6 +54,13 @@ class RequestQueueStore {
virtual void RemoveRequests(const std::vector<int64_t>& request_ids,
const RemoveCallback& callback) = 0;
+ // Asynchronously changes the state of requests from the store using their
+ // request id.
+ virtual void ChangeRequestsState(
+ const std::vector<int64_t>& request_ids,
+ const SavePageRequest::RequestState new_state,
+ const UpdateCallback& callback) = 0;
+
// Resets the store.
virtual void Reset(const ResetCallback& callback) = 0;
};

Powered by Google App Engine
This is Rietveld 408576698