| 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_STORE_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 typedef base::Callback<void( | 29 typedef base::Callback<void( |
| 30 bool /* success */, | 30 bool /* success */, |
| 31 std::vector<std::unique_ptr<SavePageRequest>> /* requests */)> | 31 std::vector<std::unique_ptr<SavePageRequest>> /* requests */)> |
| 32 GetRequestsCallback; | 32 GetRequestsCallback; |
| 33 typedef base::Callback<void(ItemActionStatus)> AddCallback; | 33 typedef base::Callback<void(ItemActionStatus)> AddCallback; |
| 34 typedef base::Callback<void(std::unique_ptr<UpdateRequestsResult>)> | 34 typedef base::Callback<void(std::unique_ptr<UpdateRequestsResult>)> |
| 35 UpdateCallback; | 35 UpdateCallback; |
| 36 typedef base::Callback<void( | 36 typedef base::Callback<void( |
| 37 const RequestQueue::UpdateMultipleRequestResults& /* statuses*/, | |
| 38 std::vector<std::unique_ptr<SavePageRequest>> /* requests */)> | |
| 39 UpdateMultipleRequestsCallback; | |
| 40 typedef base::Callback<void( | |
| 41 const RequestQueue::UpdateMultipleRequestResults& /* statuses */, | 37 const RequestQueue::UpdateMultipleRequestResults& /* statuses */, |
| 42 std::vector<std::unique_ptr<SavePageRequest>> /* requests */)> | 38 std::vector<std::unique_ptr<SavePageRequest>> /* requests */)> |
| 43 RemoveCallback; | 39 RemoveCallback; |
| 44 typedef base::Callback<void(bool /* success */)> ResetCallback; | 40 typedef base::Callback<void(bool /* success */)> ResetCallback; |
| 45 | 41 |
| 46 virtual ~RequestQueueStore(){}; | 42 virtual ~RequestQueueStore(){}; |
| 47 | 43 |
| 48 // Gets all of the requests from the store. | 44 // Gets all of the requests from the store. |
| 49 virtual void GetRequests(const GetRequestsCallback& callback) = 0; | 45 virtual void GetRequests(const GetRequestsCallback& callback) = 0; |
| 50 | 46 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 63 // Result of remove should be false, when one of the provided items couldn't | 59 // Result of remove should be false, when one of the provided items couldn't |
| 64 // be deleted, e.g. because it was missing. | 60 // be deleted, e.g. because it was missing. |
| 65 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, | 61 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 66 const RemoveCallback& callback) = 0; | 62 const RemoveCallback& callback) = 0; |
| 67 | 63 |
| 68 // Asynchronously changes the state of requests from the store using their | 64 // Asynchronously changes the state of requests from the store using their |
| 69 // request id. | 65 // request id. |
| 70 virtual void ChangeRequestsState( | 66 virtual void ChangeRequestsState( |
| 71 const std::vector<int64_t>& request_ids, | 67 const std::vector<int64_t>& request_ids, |
| 72 const SavePageRequest::RequestState new_state, | 68 const SavePageRequest::RequestState new_state, |
| 73 const UpdateMultipleRequestsCallback& callback) = 0; | 69 const UpdateCallback& callback) = 0; |
| 74 | 70 |
| 75 // Resets the store. | 71 // Resets the store. |
| 76 virtual void Reset(const ResetCallback& callback) = 0; | 72 virtual void Reset(const ResetCallback& callback) = 0; |
| 77 }; | 73 }; |
| 78 | 74 |
| 79 } // namespace offline_pages | 75 } // namespace offline_pages |
| 80 | 76 |
| 81 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ | 77 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| OLD | NEW |