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

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: Adding more UMAs and hooking up model and storage manager. 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 // 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
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_
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