| 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_OFFLINE_PAGE_MODEL_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 const OfflinePageItem* MaybeGetPageByOfflineURL( | 96 const OfflinePageItem* MaybeGetPageByOfflineURL( |
| 97 const GURL& offline_url) const override; | 97 const GURL& offline_url) const override; |
| 98 void GetPagesByOnlineURL( | 98 void GetPagesByOnlineURL( |
| 99 const GURL& online_url, | 99 const GURL& online_url, |
| 100 const MultipleOfflinePageItemCallback& callback) override; | 100 const MultipleOfflinePageItemCallback& callback) override; |
| 101 void GetBestPageForOnlineURL( | 101 void GetBestPageForOnlineURL( |
| 102 const GURL& online_url, | 102 const GURL& online_url, |
| 103 const SingleOfflinePageItemCallback callback) override; | 103 const SingleOfflinePageItemCallback callback) override; |
| 104 const OfflinePageItem* MaybeGetBestPageForOnlineURL( | 104 const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
| 105 const GURL& online_url) const override; | 105 const GURL& online_url) const override; |
| 106 void CheckForExternalFileDeletion() override; | 106 void CheckMetadataConsistency() override; |
| 107 void ExpirePages(const std::vector<int64_t>& offline_ids, | 107 void ExpirePages(const std::vector<int64_t>& offline_ids, |
| 108 const base::Time& expiration_time, | 108 const base::Time& expiration_time, |
| 109 const base::Callback<void(bool)>& callback) override; | 109 const base::Callback<void(bool)>& callback) override; |
| 110 ClientPolicyController* GetPolicyController() override; | 110 ClientPolicyController* GetPolicyController() override; |
| 111 | 111 |
| 112 // Methods for testing only: | 112 // Methods for testing only: |
| 113 OfflinePageMetadataStore* GetStoreForTesting(); | 113 OfflinePageMetadataStore* GetStoreForTesting(); |
| 114 | 114 |
| 115 OfflinePageStorageManager* GetStorageManager(); | 115 OfflinePageStorageManager* GetStorageManager(); |
| 116 | 116 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 bool success); | 186 bool success); |
| 187 void OnRemoveOfflinePagesDone(const std::vector<int64_t>& offline_ids, | 187 void OnRemoveOfflinePagesDone(const std::vector<int64_t>& offline_ids, |
| 188 const DeletePageCallback& callback, | 188 const DeletePageCallback& callback, |
| 189 bool success); | 189 bool success); |
| 190 void InformDeletePageDone(const DeletePageCallback& callback, | 190 void InformDeletePageDone(const DeletePageCallback& callback, |
| 191 DeletePageResult result); | 191 DeletePageResult result); |
| 192 | 192 |
| 193 void OnMarkPageAccesseDone(const OfflinePageItem& offline_page_item, | 193 void OnMarkPageAccesseDone(const OfflinePageItem& offline_page_item, |
| 194 bool success); | 194 bool success); |
| 195 | 195 |
| 196 // Callbacks for checking if offline pages are missing archive files. | 196 // Callbacks for checking metadata consistency. |
| 197 void ScanForMissingArchiveFiles( | 197 void DoCheckMetadataConsistency( |
| 198 const std::set<base::FilePath>& archive_paths); | 198 const std::set<base::FilePath>& archive_paths); |
| 199 void OnRemoveOfflinePagesMissingArchiveFileDone( | 199 // Callback called after headless archives deleted. Orphaned archives are |
| 200 const std::vector<std::pair<int64_t, ClientId>>& offline_client_id_pairs, | 200 // archives files on disk which are not pointed to by any of the page items |
| 201 DeletePageResult result); | 201 // in metadata store. |
| 202 void ExpirePagesMissingArchiveFile( |
| 203 const std::set<base::FilePath>& archive_paths); |
| 204 void OnExpirePagesMissingArchiveFileDone( |
| 205 const std::vector<int64_t>& offline_ids, |
| 206 bool success); |
| 207 void DeleteOrphanedArchives(const std::set<base::FilePath>& archive_paths); |
| 208 void OnDeleteOrphanedArchivesDone(const std::vector<base::FilePath>& archives, |
| 209 bool success); |
| 202 | 210 |
| 203 // Steps for clearing all. | 211 // Steps for clearing all. |
| 204 void OnRemoveAllFilesDoneForClearAll(const base::Closure& callback, | 212 void OnRemoveAllFilesDoneForClearAll(const base::Closure& callback, |
| 205 DeletePageResult result); | 213 DeletePageResult result); |
| 206 void OnResetStoreDoneForClearAll(const base::Closure& callback, bool success); | 214 void OnResetStoreDoneForClearAll(const base::Closure& callback, bool success); |
| 207 void OnReloadStoreDoneForClearAll( | 215 void OnReloadStoreDoneForClearAll( |
| 208 const base::Closure& callback, | 216 const base::Closure& callback, |
| 209 OfflinePageMetadataStore::LoadStatus load_status, | 217 OfflinePageMetadataStore::LoadStatus load_status, |
| 210 const std::vector<OfflinePageItem>& offline_pages); | 218 const std::vector<OfflinePageItem>& offline_pages); |
| 211 | 219 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 std::unique_ptr<ArchiveManager> archive_manager_; | 274 std::unique_ptr<ArchiveManager> archive_manager_; |
| 267 | 275 |
| 268 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 276 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
| 269 | 277 |
| 270 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 278 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
| 271 }; | 279 }; |
| 272 | 280 |
| 273 } // namespace offline_pages | 281 } // namespace offline_pages |
| 274 | 282 |
| 275 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 283 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
| OLD | NEW |