| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_OFFLINE_PAGE_MODEL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const ClientId& client_id, | 89 const ClientId& client_id, |
| 90 int64_t proposed_offline_id, | 90 int64_t proposed_offline_id, |
| 91 std::unique_ptr<OfflinePageArchiver> archiver, | 91 std::unique_ptr<OfflinePageArchiver> archiver, |
| 92 const SavePageCallback& callback) = 0; | 92 const SavePageCallback& callback) = 0; |
| 93 | 93 |
| 94 // Marks that the offline page related to the passed |offline_id| has been | 94 // Marks that the offline page related to the passed |offline_id| has been |
| 95 // accessed. Its access info, including last access time and access count, | 95 // accessed. Its access info, including last access time and access count, |
| 96 // will be updated. Requires that the model is loaded. | 96 // will be updated. Requires that the model is loaded. |
| 97 virtual void MarkPageAccessed(int64_t offline_id) = 0; | 97 virtual void MarkPageAccessed(int64_t offline_id) = 0; |
| 98 | 98 |
| 99 // Wipes out all the data by deleting all saved files and clearing the store. | |
| 100 virtual void ClearAll(const base::Closure& callback) = 0; | |
| 101 | |
| 102 // Deletes pages based on |offline_ids|. | 99 // Deletes pages based on |offline_ids|. |
| 103 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 100 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
| 104 const DeletePageCallback& callback) = 0; | 101 const DeletePageCallback& callback) = 0; |
| 105 | 102 |
| 106 // Deletes cached offline pages matching the URL predicate. | 103 // Deletes cached offline pages matching the URL predicate. |
| 107 virtual void DeleteCachedPagesByURLPredicate( | 104 virtual void DeleteCachedPagesByURLPredicate( |
| 108 const UrlPredicate& predicate, | 105 const UrlPredicate& predicate, |
| 109 const DeletePageCallback& callback) = 0; | 106 const DeletePageCallback& callback) = 0; |
| 110 | 107 |
| 111 // Returns via callback all GURLs in |urls| that are equal to the online URL | 108 // Returns via callback all GURLs in |urls| that are equal to the online URL |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // TODO(dougarnett): Remove this and its uses. | 184 // TODO(dougarnett): Remove this and its uses. |
| 188 virtual bool is_loaded() const = 0; | 185 virtual bool is_loaded() const = 0; |
| 189 | 186 |
| 190 // Returns the logger. Ownership is retained by the model. | 187 // Returns the logger. Ownership is retained by the model. |
| 191 virtual OfflineEventLogger* GetLogger() = 0; | 188 virtual OfflineEventLogger* GetLogger() = 0; |
| 192 }; | 189 }; |
| 193 | 190 |
| 194 } // namespace offline_pages | 191 } // namespace offline_pages |
| 195 | 192 |
| 196 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 193 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |