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

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

Issue 2438503003: [Offline pages] Add MarkAttemptAbortedTask to Request Queue (Closed)
Patch Set: Addressing feedback -- adding comments and documentation 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_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Changes the state to |new_state| for requests matching the 92 // Changes the state to |new_state| for requests matching the
93 // |request_ids|. Results are returned through |callback|. 93 // |request_ids|. Results are returned through |callback|.
94 void ChangeRequestsState(const std::vector<int64_t>& request_ids, 94 void ChangeRequestsState(const std::vector<int64_t>& request_ids,
95 const SavePageRequest::RequestState new_state, 95 const SavePageRequest::RequestState new_state,
96 const UpdateCallback& callback); 96 const UpdateCallback& callback);
97 97
98 // Marks attempt with |request_id| as started. Results are returned through 98 // Marks attempt with |request_id| as started. Results are returned through
99 // |callback|. 99 // |callback|.
100 void MarkAttemptStarted(int64_t request_id, const UpdateCallback& callback); 100 void MarkAttemptStarted(int64_t request_id, const UpdateCallback& callback);
101 101
102 // Marks attempt with |request_id| as aborted. Results are returned through
103 // |callback|.
104 void MarkAttemptAborted(int64_t request_id, const UpdateCallback& callback);
105
102 void GetForUpdateDone( 106 void GetForUpdateDone(
103 const RequestQueue::UpdateRequestCallback& update_callback, 107 const RequestQueue::UpdateRequestCallback& update_callback,
104 const SavePageRequest& update_request, 108 const SavePageRequest& update_request,
105 bool success, 109 bool success,
106 std::vector<std::unique_ptr<SavePageRequest>> requests); 110 std::vector<std::unique_ptr<SavePageRequest>> requests);
107 111
108 private: 112 private:
109 // Callback used by |PurgeRequests|. 113 // Callback used by |PurgeRequests|.
110 typedef base::Callback<void(UpdateRequestResult, 114 typedef base::Callback<void(UpdateRequestResult,
111 int /* removed requests count */)> 115 int /* removed requests count */)>
(...skipping 11 matching lines...) Expand all
123 127
124 // Allows us to pass a weak pointer to callbacks. 128 // Allows us to pass a weak pointer to callbacks.
125 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; 129 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_;
126 130
127 DISALLOW_COPY_AND_ASSIGN(RequestQueue); 131 DISALLOW_COPY_AND_ASSIGN(RequestQueue);
128 }; 132 };
129 133
130 } // namespace offline_pages 134 } // namespace offline_pages
131 135
132 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ 136 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | components/offline_pages/background/request_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698