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

Unified Diff: components/offline_pages/offline_page_metadata_store.h

Issue 2497703002: [Offline pages] Resetting offline page metadata store to handle LOAD/INIT failures (Closed)
Patch Set: Addressing STORE_INIT_FAILED Created 4 years, 1 month 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_metadata_store.h
diff --git a/components/offline_pages/offline_page_metadata_store.h b/components/offline_pages/offline_page_metadata_store.h
index 26314804bdce08b2df6e0ad0280aee4937a3fb73..8613df7a9825c43aa53fb219386e3062960c4a05 100644
--- a/components/offline_pages/offline_page_metadata_store.h
+++ b/components/offline_pages/offline_page_metadata_store.h
@@ -38,16 +38,19 @@ class OfflinePageMetadataStore {
LOAD_STATUS_COUNT
};
- typedef base::Callback<void(LoadStatus, const std::vector<OfflinePageItem>&)>
+ typedef base::Callback<void(const std::vector<OfflinePageItem>&)>
LoadCallback;
+ typedef base::Callback<void(StoreState)> InitializeCallback;
typedef base::Callback<void(ItemActionStatus)> AddCallback;
typedef base::Callback<void(std::unique_ptr<OfflinePagesUpdateResult>)>
UpdateCallback;
- typedef base::Callback<void(bool)> ResetCallback;
OfflinePageMetadataStore();
virtual ~OfflinePageMetadataStore();
+ // Initializes the store. Should be called before any other methods.
+ virtual void Initialize(const InitializeCallback& callback) = 0;
+
// Get all of the offline pages from the store.
virtual void GetOfflinePages(const LoadCallback& callback) = 0;
@@ -65,7 +68,7 @@ class OfflinePageMetadataStore {
const UpdateCallback& callback) = 0;
// Resets the store.
- virtual void Reset(const ResetCallback& callback) = 0;
+ virtual void Reset(const InitializeCallback& callback) = 0;
// Gets the store state.
virtual StoreState state() const = 0;

Powered by Google App Engine
This is Rietveld 408576698