| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 void ClearStorageIfNeeded( | 250 void ClearStorageIfNeeded( |
| 251 const OfflinePageStorageManager::ClearStorageCallback& callback); | 251 const OfflinePageStorageManager::ClearStorageCallback& callback); |
| 252 | 252 |
| 253 // Callback completing storage clearing. | 253 // Callback completing storage clearing. |
| 254 void OnStorageCleared(size_t expired_page_count, | 254 void OnStorageCleared(size_t expired_page_count, |
| 255 OfflinePageStorageManager::ClearStorageResult result); | 255 OfflinePageStorageManager::ClearStorageResult result); |
| 256 | 256 |
| 257 // Post task to clear storage. | 257 // Post task to clear storage. |
| 258 void PostClearStorageIfNeededTask(); | 258 void PostClearStorageIfNeededTask(); |
| 259 | 259 |
| 260 // Check if |offline_page| is user-requested. | 260 // Check if |offline_page| should be removed on cache reset by user. |
| 261 bool IsUserRequestedPage(const OfflinePageItem& offline_page) const; | 261 bool IsRemovedOnCacheReset(const OfflinePageItem& offline_page) const; |
| 262 | 262 |
| 263 void RunWhenLoaded(const base::Closure& job); | 263 void RunWhenLoaded(const base::Closure& job); |
| 264 | 264 |
| 265 base::Time GetCurrentTime() const; | 265 base::Time GetCurrentTime() const; |
| 266 | 266 |
| 267 // Persistent store for offline page metadata. | 267 // Persistent store for offline page metadata. |
| 268 std::unique_ptr<OfflinePageMetadataStore> store_; | 268 std::unique_ptr<OfflinePageMetadataStore> store_; |
| 269 | 269 |
| 270 // Location where all of the archive files will be stored. | 270 // Location where all of the archive files will be stored. |
| 271 base::FilePath archives_dir_; | 271 base::FilePath archives_dir_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 302 base::Clock* testing_clock_; | 302 base::Clock* testing_clock_; |
| 303 | 303 |
| 304 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 304 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
| 305 | 305 |
| 306 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 306 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 } // namespace offline_pages | 309 } // namespace offline_pages |
| 310 | 310 |
| 311 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 311 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
| OLD | NEW |