| 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 | 12 |
| 13 namespace offline_pages { | 13 namespace offline_pages { |
| 14 | 14 |
| 15 class SavePageRequest; | 15 class SavePageRequest; |
| 16 | 16 |
| 17 // Interface for classes storing save page requests. | 17 // Interface for classes storing save page requests. |
| 18 class RequestQueueStore { | 18 class RequestQueueStore { |
| 19 public: | 19 public: |
| 20 enum class UpdateStatus { | 20 enum class UpdateStatus { |
| 21 kAdded, // Request was added successfully. | 21 ADDED, // Request was added successfully. |
| 22 kUpdated, // Request was updated successfully. | 22 UPDATED, // Request was updated successfully. |
| 23 kFailed, // Add or update attempt failed. | 23 FAILED, // Add or update attempt failed. |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 typedef base::Callback<void( | 26 typedef base::Callback<void( |
| 27 bool /* success */, | 27 bool /* success */, |
| 28 const std::vector<SavePageRequest>& /* requests */)> | 28 const std::vector<SavePageRequest>& /* requests */)> |
| 29 GetRequestsCallback; | 29 GetRequestsCallback; |
| 30 typedef base::Callback<void(UpdateStatus)> UpdateCallback; | 30 typedef base::Callback<void(UpdateStatus)> UpdateCallback; |
| 31 typedef base::Callback<void(bool /* success */, | 31 typedef base::Callback<void(bool /* success */, |
| 32 int /* number of deleted requests */)> | 32 int /* number of deleted requests */)> |
| 33 RemoveCallback; | 33 RemoveCallback; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, | 51 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 52 const RemoveCallback& callback) = 0; | 52 const RemoveCallback& callback) = 0; |
| 53 | 53 |
| 54 // Resets the store. | 54 // Resets the store. |
| 55 virtual void Reset(const ResetCallback& callback) = 0; | 55 virtual void Reset(const ResetCallback& callback) = 0; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace offline_pages | 58 } // namespace offline_pages |
| 59 | 59 |
| 60 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ | 60 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| OLD | NEW |