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

Side by Side Diff: components/offline_pages/background/request_queue_store.h

Issue 1951483002: [Offline pages] Adding in memory request queue store with tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_
7
8 #include <stdint.h>
9 #include <vector>
10
11 #include "base/callback.h"
12
13 namespace offline_pages {
14
15 class SavePageRequest;
16
17 // Interface for classes storing save page requests.
18 class RequestQueueStore {
19 public:
20 typedef base::Callback<void(bool, const std::vector<SavePageRequest>&)>
21 GetRequestsCallback;
22 typedef base::Callback<void(bool)> UpdateCallback;
23 typedef base::Callback<void(bool)> ResetCallback;
24
25 virtual ~RequestQueueStore(){};
26
27 // Gets all of the requests from the store.
28 virtual void GetRequests(const GetRequestsCallback& callback) = 0;
Pete Williamson 2016/05/03 20:38:52 Why make this async again? (Sorry if I already as
fgorski 2016/05/03 21:50:21 You know we need to read these from the drive eith
Pete Williamson 2016/05/03 22:00:25 Ah yes, that was why. This is OK as is.
29
30 // Asynchronously adds or updates request in store.
31 // Result of the update is passed in the callback.
32 virtual void AddOrUpdateRequest(const SavePageRequest& request,
33 const UpdateCallback& callback) = 0;
34
35 // Asynchronously removes requests from the store using their IDs.
36 // Result of the update is passed in the callback.
Pete Williamson 2016/05/03 20:38:52 Let's be a bit more specific - returns true if any
fgorski 2016/05/03 21:50:21 Done.
37 virtual void RemoveRequests(const std::vector<int64_t>& request_ids,
38 const UpdateCallback& callback) = 0;
39
40 // Resets the store.
41 virtual void Reset(const ResetCallback& callback) = 0;
42 };
43
44 } // namespace offline_pages
45
46 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698