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

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

Issue 2372043002: [Offline pages] Applying TaskQueue to RequestQueue::ChangeRequestsState (Closed)
Patch Set: Addressing feedback from dougarnett Created 4 years, 2 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_ 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 16 matching lines...) Expand all
27 const AddCallback& callback) override; 27 const AddCallback& callback) override;
28 void UpdateRequests(const std::vector<SavePageRequest>& requests, 28 void UpdateRequests(const std::vector<SavePageRequest>& requests,
29 const UpdateCallback& callback) override; 29 const UpdateCallback& callback) override;
30 30
31 // Remove requests by request ID. The callback will get a list of 31 // Remove requests by request ID. The callback will get a list of
32 // UpdateMultipleRequestResults and a list of the removed requests (for use by 32 // UpdateMultipleRequestResults and a list of the removed requests (for use by
33 // notifications). 33 // notifications).
34 void RemoveRequests(const std::vector<int64_t>& request_ids, 34 void RemoveRequests(const std::vector<int64_t>& request_ids,
35 const RemoveCallback& callback) override; 35 const RemoveCallback& callback) override;
36 36
37 // Set the state of associated requests to |new_state|. The callback will get
38 // a list of UpdateMultipleRequestResults, and a list of the updated requests.
39 void ChangeRequestsState(
40 const std::vector<int64_t>& request_ids,
41 const SavePageRequest::RequestState new_state,
42 const UpdateMultipleRequestsCallback& callback) override;
43
44 void Reset(const ResetCallback& callback) override; 37 void Reset(const ResetCallback& callback) override;
45 38
46 private: 39 private:
47 typedef std::map<int64_t, SavePageRequest> RequestsMap; 40 typedef std::map<int64_t, SavePageRequest> RequestsMap;
48 RequestsMap requests_; 41 RequestsMap requests_;
49 42
50 DISALLOW_COPY_AND_ASSIGN(RequestQueueInMemoryStore); 43 DISALLOW_COPY_AND_ASSIGN(RequestQueueInMemoryStore);
51 }; 44 };
52 45
53 } // namespace offline_pages 46 } // namespace offline_pages
54 47
55 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_ 48 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698