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

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: More FGorski CR feedback 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 d4a9d3527a3a16e716d87e4e3b0f7435e1a38540..3c67037d086091720f966c10786573273e05fac3 100644
--- a/components/offline_pages/background/request_queue_store.h
+++ b/components/offline_pages/background/request_queue_store.h
@@ -9,12 +9,11 @@
#include <vector>
#include "base/callback.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 +22,8 @@ class RequestQueueStore {
UPDATED, // Request was updated successfully.
FAILED, // Add or update attempt failed.
};
+ // TODO(fgorski): What if no items were updated? Maybe this should work more
Dmitry Titov 2016/08/11 04:25:54 I think this is TODO(petewil) based on changing Ch
Pete Williamson 2016/08/12 00:06:46 Done.
+ // like DeleteCallback.
typedef base::Callback<void(
bool /* success */,
@@ -61,6 +62,13 @@ class RequestQueueStore {
virtual void RemoveRequestsByClientId(const std::vector<ClientId>& client_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