| OLD | NEW |
| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // others. | 88 // others. |
| 89 void RemoveRequests(const std::vector<int64_t>& request_ids, | 89 void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 90 const UpdateCallback& callback); | 90 const UpdateCallback& callback); |
| 91 | 91 |
| 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 |
| 99 // |callback|. |
| 100 void MarkAttemptStarted(int64_t request_id, const UpdateCallback& callback); |
| 101 |
| 98 void GetForUpdateDone( | 102 void GetForUpdateDone( |
| 99 const RequestQueue::UpdateRequestCallback& update_callback, | 103 const RequestQueue::UpdateRequestCallback& update_callback, |
| 100 const SavePageRequest& update_request, | 104 const SavePageRequest& update_request, |
| 101 bool success, | 105 bool success, |
| 102 std::vector<std::unique_ptr<SavePageRequest>> requests); | 106 std::vector<std::unique_ptr<SavePageRequest>> requests); |
| 103 | 107 |
| 104 private: | 108 private: |
| 105 // Callback used by |PurgeRequests|. | 109 // Callback used by |PurgeRequests|. |
| 106 typedef base::Callback<void(UpdateRequestResult, | 110 typedef base::Callback<void(UpdateRequestResult, |
| 107 int /* removed requests count */)> | 111 int /* removed requests count */)> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 119 | 123 |
| 120 // Allows us to pass a weak pointer to callbacks. | 124 // Allows us to pass a weak pointer to callbacks. |
| 121 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; | 125 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; |
| 122 | 126 |
| 123 DISALLOW_COPY_AND_ASSIGN(RequestQueue); | 127 DISALLOW_COPY_AND_ASSIGN(RequestQueue); |
| 124 }; | 128 }; |
| 125 | 129 |
| 126 } // namespace offline_pages | 130 } // namespace offline_pages |
| 127 | 131 |
| 128 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ | 132 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ |
| OLD | NEW |