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

Unified Diff: components/offline_pages/offline_page_storage_manager.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, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_storage_manager.h
diff --git a/components/offline_pages/offline_page_storage_manager.h b/components/offline_pages/offline_page_storage_manager.h
index 38a817efd1f718eb127d6ab673b08ed54a8648c9..1ae5d55caf81d59f3c969c8619109442544df89b 100644
--- a/components/offline_pages/offline_page_storage_manager.h
+++ b/components/offline_pages/offline_page_storage_manager.h
@@ -74,12 +74,16 @@ class OfflinePageStorageManager {
EXPIRE_FAILURE, // Expiration failed.
DELETE_FAILURE, // Deletion failed.
BOTH_FAILURE, // Both expiration and deletion failed.
+ // NOTE: always keep this entry at the end. Add new result types only
+ // immediately above this line. Make sure to update the corresponding
+ // histogram enum accordingly.
+ RESULT_COUNT,
};
// Callback used when calling ClearPagesIfNeeded.
// size_t: the number of expired pages.
// ClearStorageResult: result of expiring pages in storage.
- typedef base::Callback<void(size_t, ClearStorageResult)> ClearPagesCallback;
+ typedef base::Callback<void(size_t, ClearStorageResult)> ClearStorageCallback;
explicit OfflinePageStorageManager(Client* client,
ClientPolicyController* policy_controller,
@@ -92,7 +96,7 @@ class OfflinePageStorageManager {
// It clears the storage (expire pages) when it's using more disk space than a
// certain limit, or the time elapsed from last time clearing is longer than a
// certain interval. Both values are defined above.
- void ClearPagesIfNeeded(const ClearPagesCallback& callback);
+ void ClearPagesIfNeeded(const ClearStorageCallback& callback);
// Sets the clock for testing.
void SetClockForTesting(std::unique_ptr<base::Clock> clock);
@@ -110,23 +114,23 @@ class OfflinePageStorageManager {
// Callback called after getting storage stats from archive manager.
void OnGetStorageStatsDoneForClearingPages(
- const ClearPagesCallback& callback,
+ const ClearStorageCallback& callback,
const ArchiveManager::StorageStats& pages);
// Callback called after getting all pages from client done.
void OnGetAllPagesDoneForClearingPages(
- const ClearPagesCallback& callback,
+ const ClearStorageCallback& callback,
const ArchiveManager::StorageStats& storage_stats,
const MultipleOfflinePageItemResult& pages);
// Callback called after expired pages have been deleted.
- void OnPagesExpired(const ClearPagesCallback& callback,
+ void OnPagesExpired(const ClearStorageCallback& callback,
size_t pages_to_clear,
const std::vector<int64_t>& page_ids_to_remove,
bool expiration_succeeded);
// Callback called after clearing outdated pages from client.
- void OnOutdatedPagesCleared(const ClearPagesCallback& callback,
+ void OnOutdatedPagesCleared(const ClearStorageCallback& callback,
size_t pages_cleared,
bool expiration_succeeded,
DeletePageResult result);

Powered by Google App Engine
This is Rietveld 408576698