Chromium Code Reviews| 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 <map> | 10 #include <map> |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and | 333 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and |
| 334 // requires that the model is loaded. | 334 // requires that the model is loaded. |
| 335 void DoDeletePagesByURLPredicate(const UrlPredicate& predicate, | 335 void DoDeletePagesByURLPredicate(const UrlPredicate& predicate, |
| 336 const DeletePageCallback& callback); | 336 const DeletePageCallback& callback); |
| 337 | 337 |
| 338 // Callback completing page expiration. | 338 // Callback completing page expiration. |
| 339 void OnExpirePageDone(int64_t offline_id, | 339 void OnExpirePageDone(int64_t offline_id, |
| 340 const base::Time& expiration_time, | 340 const base::Time& expiration_time, |
| 341 bool success); | 341 bool success); |
| 342 | 342 |
| 343 // Calls storage manager to clear expired pages if there's any. Used to | |
|
jianli
2016/05/27 19:16:13
nit: you don't need to explain the implementation
romax
2016/05/27 20:36:02
Done.
| |
| 344 // invoke ClearPagesIfNeeded on storage manager to clear storage | |
| 345 // 'automatically'. | |
| 346 void ClearStorageIfNeeded( | |
| 347 const OfflinePageStorageManager::ClearStorageCallback& callback); | |
| 348 | |
| 349 // Callback completing storage clearing/ | |
|
jianli
2016/05/27 19:16:13
nit: / => .
romax
2016/05/27 20:36:02
Done.
| |
| 350 void OnStorageCleared(const size_t expired_page_count, | |
| 351 OfflinePageStorageManager::ClearStorageResult result); | |
| 352 | |
| 343 void RunWhenLoaded(const base::Closure& job); | 353 void RunWhenLoaded(const base::Closure& job); |
| 344 | 354 |
| 345 // Persistent store for offline page metadata. | 355 // Persistent store for offline page metadata. |
| 346 std::unique_ptr<OfflinePageMetadataStore> store_; | 356 std::unique_ptr<OfflinePageMetadataStore> store_; |
| 347 | 357 |
| 348 // Location where all of the archive files will be stored. | 358 // Location where all of the archive files will be stored. |
| 349 base::FilePath archives_dir_; | 359 base::FilePath archives_dir_; |
| 350 | 360 |
| 351 // The observers. | 361 // The observers. |
| 352 base::ObserverList<Observer> observers_; | 362 base::ObserverList<Observer> observers_; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 373 std::unique_ptr<ArchiveManager> archive_manager_; | 383 std::unique_ptr<ArchiveManager> archive_manager_; |
| 374 | 384 |
| 375 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; | 385 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; |
| 376 | 386 |
| 377 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); | 387 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); |
| 378 }; | 388 }; |
| 379 | 389 |
| 380 } // namespace offline_pages | 390 } // namespace offline_pages |
| 381 | 391 |
| 382 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 392 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |