Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: components/offline_pages/offline_page_model.h

Issue 2015793002: [Offline Pages] Linking storage manager and model with UMAs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wisp
Patch Set: Addressing comments. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Clears expired pages if there are any.
344 void ClearStorageIfNeeded(
345 const OfflinePageStorageManager::ClearStorageCallback& callback);
346
347 // Callback completing storage clearing.
348 void OnStorageCleared(size_t expired_page_count,
349 OfflinePageStorageManager::ClearStorageResult result);
350
343 void RunWhenLoaded(const base::Closure& job); 351 void RunWhenLoaded(const base::Closure& job);
344 352
345 // Persistent store for offline page metadata. 353 // Persistent store for offline page metadata.
346 std::unique_ptr<OfflinePageMetadataStore> store_; 354 std::unique_ptr<OfflinePageMetadataStore> store_;
347 355
348 // Location where all of the archive files will be stored. 356 // Location where all of the archive files will be stored.
349 base::FilePath archives_dir_; 357 base::FilePath archives_dir_;
350 358
351 // The observers. 359 // The observers.
352 base::ObserverList<Observer> observers_; 360 base::ObserverList<Observer> observers_;
(...skipping 20 matching lines...) Expand all
373 std::unique_ptr<ArchiveManager> archive_manager_; 381 std::unique_ptr<ArchiveManager> archive_manager_;
374 382
375 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; 383 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_;
376 384
377 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); 385 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel);
378 }; 386 };
379 387
380 } // namespace offline_pages 388 } // namespace offline_pages
381 389
382 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 390 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | components/offline_pages/offline_page_model.cc » ('j') | components/offline_pages/offline_page_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698