| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Returns the offline pages that are stored under |online_url|. | 161 // Returns the offline pages that are stored under |online_url|. |
| 162 virtual void GetPagesByOnlineURL( | 162 virtual void GetPagesByOnlineURL( |
| 163 const GURL& online_url, | 163 const GURL& online_url, |
| 164 const MultipleOfflinePageItemCallback& callback) = 0; | 164 const MultipleOfflinePageItemCallback& callback) = 0; |
| 165 | 165 |
| 166 // Returns an offline page saved for |online_url|. A nullptr is returned if | 166 // Returns an offline page saved for |online_url|. A nullptr is returned if |
| 167 // not found. See |GetBestPageForOnlineURL| for selection criteria. | 167 // not found. See |GetBestPageForOnlineURL| for selection criteria. |
| 168 virtual const OfflinePageItem* MaybeGetBestPageForOnlineURL( | 168 virtual const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
| 169 const GURL& online_url) const = 0; | 169 const GURL& online_url) const = 0; |
| 170 | 170 |
| 171 // Checks that all of the offline pages have corresponding offline copies, | |
| 172 // and all archived files have offline pages pointing to them. | |
| 173 // If a page is discovered to be missing an offline copy, its offline page | |
| 174 // metadata will be expired. If an archive file is discovered missing its | |
| 175 // offline page, it will be deleted. | |
| 176 virtual void CheckMetadataConsistency() = 0; | |
| 177 | |
| 178 // Marks pages with |offline_ids| as expired and deletes the associated | 171 // Marks pages with |offline_ids| as expired and deletes the associated |
| 179 // archive files. | 172 // archive files. |
| 180 virtual void ExpirePages(const std::vector<int64_t>& offline_ids, | 173 virtual void ExpirePages(const std::vector<int64_t>& offline_ids, |
| 181 const base::Time& expiration_time, | 174 const base::Time& expiration_time, |
| 182 const base::Callback<void(bool)>& callback) = 0; | 175 const base::Callback<void(bool)>& callback) = 0; |
| 183 | 176 |
| 184 // Returns the policy controller. | 177 // Returns the policy controller. |
| 185 virtual ClientPolicyController* GetPolicyController() = 0; | 178 virtual ClientPolicyController* GetPolicyController() = 0; |
| 186 | 179 |
| 187 // TODO(dougarnett): Remove this and its uses. | 180 // TODO(dougarnett): Remove this and its uses. |
| 188 virtual bool is_loaded() const = 0; | 181 virtual bool is_loaded() const = 0; |
| 189 | 182 |
| 190 // Returns the logger. Ownership is retained by the model. | 183 // Returns the logger. Ownership is retained by the model. |
| 191 virtual OfflineEventLogger* GetLogger() = 0; | 184 virtual OfflineEventLogger* GetLogger() = 0; |
| 192 }; | 185 }; |
| 193 | 186 |
| 194 } // namespace offline_pages | 187 } // namespace offline_pages |
| 195 | 188 |
| 196 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 189 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |