| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "components/offline_pages/offline_page_item.h" | |
| 13 | 12 |
| 14 namespace offline_pages { | 13 namespace offline_pages { |
| 15 | 14 |
| 16 class SavePageRequest; | 15 class SavePageRequest; |
| 17 | 16 |
| 18 // Interface for classes storing save page requests. | 17 // Interface for classes storing save page requests. |
| 19 class RequestQueueStore { | 18 class RequestQueueStore { |
| 20 public: | 19 public: |
| 21 enum class UpdateStatus { | 20 enum class UpdateStatus { |
| 22 ADDED, // Request was added successfully. | 21 ADDED, // Request was added successfully. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 const UpdateCallback& callback) = 0; | 44 const UpdateCallback& callback) = 0; |
| 46 | 45 |
| 47 // Asynchronously removes requests from the store using their IDs. | 46 // Asynchronously removes requests from the store using their IDs. |
| 48 // Result of the update, and a number of removed pages is passed in the | 47 // Result of the update, and a number of removed pages is passed in the |
| 49 // callback. | 48 // callback. |
| 50 // Result of remove should be false, when one of the provided items couldn't | 49 // Result of remove should be false, when one of the provided items couldn't |
| 51 // be deleted, e.g. because it was missing. | 50 // be deleted, e.g. because it was missing. |
| 52 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, | 51 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 53 const RemoveCallback& callback) = 0; | 52 const RemoveCallback& callback) = 0; |
| 54 | 53 |
| 55 // Asynchronously removes requests from the store using their ClientIds. | |
| 56 // Result of the update, and a number of removed pages is passed in the | |
| 57 // callback. Result of remove should be false, when one of the provided items | |
| 58 // couldn't be deleted, e.g. because it was missing. In case client_ids is | |
| 59 // empty, though this will return true, but the count of deleted pages will be | |
| 60 // 0. | |
| 61 virtual void RemoveRequestsByClientId(const std::vector<ClientId>& client_ids, | |
| 62 const RemoveCallback& callback) = 0; | |
| 63 | |
| 64 // Resets the store. | 54 // Resets the store. |
| 65 virtual void Reset(const ResetCallback& callback) = 0; | 55 virtual void Reset(const ResetCallback& callback) = 0; |
| 66 }; | 56 }; |
| 67 | 57 |
| 68 } // namespace offline_pages | 58 } // namespace offline_pages |
| 69 | 59 |
| 70 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ | 60 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| OLD | NEW |