Chromium Code Reviews| 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" | |
| 12 | 13 |
| 13 namespace offline_pages { | 14 namespace offline_pages { |
| 14 | 15 |
| 15 class SavePageRequest; | 16 class SavePageRequest; |
| 16 | 17 |
| 17 // Interface for classes storing save page requests. | 18 // Interface for classes storing save page requests. |
| 18 class RequestQueueStore { | 19 class RequestQueueStore { |
| 19 public: | 20 public: |
| 20 enum class UpdateStatus { | 21 enum class UpdateStatus { |
| 21 ADDED, // Request was added successfully. | 22 ADDED, // Request was added successfully. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 44 const UpdateCallback& callback) = 0; | 45 const UpdateCallback& callback) = 0; |
| 45 | 46 |
| 46 // Asynchronously removes requests from the store using their IDs. | 47 // Asynchronously removes requests from the store using their IDs. |
| 47 // Result of the update, and a number of removed pages is passed in the | 48 // Result of the update, and a number of removed pages is passed in the |
| 48 // callback. | 49 // callback. |
| 49 // Result of remove should be false, when one of the provided items couldn't | 50 // Result of remove should be false, when one of the provided items couldn't |
| 50 // be deleted, e.g. because it was missing. | 51 // be deleted, e.g. because it was missing. |
| 51 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, | 52 virtual void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 52 const RemoveCallback& callback) = 0; | 53 const RemoveCallback& callback) = 0; |
| 53 | 54 |
| 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. | |
| 58 // Result of remove should be false, when one of the provided items couldn't | |
|
Dmitry Titov
2016/08/01 19:37:31
This is better reconciled with the comment from .c
Pete Williamson
2016/08/01 23:23:08
Done.
| |
| 59 // be deleted, e.g. because it was missing. | |
| 60 virtual void RemoveRequestsByClientId(const std::vector<ClientId>& client_ids, | |
| 61 const RemoveCallback& callback) = 0; | |
| 62 | |
| 54 // Resets the store. | 63 // Resets the store. |
| 55 virtual void Reset(const ResetCallback& callback) = 0; | 64 virtual void Reset(const ResetCallback& callback) = 0; |
| 56 }; | 65 }; |
| 57 | 66 |
| 58 } // namespace offline_pages | 67 } // namespace offline_pages |
| 59 | 68 |
| 60 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ | 69 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_H_ |
| OLD | NEW |