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

Unified Diff: components/offline_pages/offline_page_metadata_store.h

Issue 2329283002: [Offline pages] OPM SQL store: moving load to constructor, updating read to GetOfflinePages (Closed)
Patch Set: Addressing CR feedback Created 4 years, 3 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
« no previous file with comments | « no previous file | components/offline_pages/offline_page_metadata_store_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e4c57c5fc41cbac0eb0872c0ed9fb718605856b4..b2e34e2516535f71314f9011d0fb245f96b93bf0 100644
--- a/components/offline_pages/offline_page_metadata_store.h
+++ b/components/offline_pages/offline_page_metadata_store.h
@@ -36,6 +36,16 @@ class OfflinePageMetadataStore {
LOAD_STATUS_COUNT
};
+ // TODO(fgorski): This enum is meant to replace |LoadStatus|.
+ // Current store state. When LOADED, the store is operational. When
+ // initialization or reset fails, it is reflected appropriately.
+ enum StoreState {
+ NOT_LOADED,
+ LOADED,
+ FAILED_INITIALIZATION,
+ FAILED_RESET,
+ };
+
typedef base::Callback<void(LoadStatus, const std::vector<OfflinePageItem>&)>
LoadCallback;
typedef base::Callback<void(bool)> UpdateCallback;
@@ -45,7 +55,7 @@ class OfflinePageMetadataStore {
virtual ~OfflinePageMetadataStore();
// Get all of the offline pages from the store.
- virtual void Load(const LoadCallback& callback) = 0;
+ virtual void GetOfflinePages(const LoadCallback& callback) = 0;
// Asynchronously adds or updates offline page metadata to the store.
// Result of the update is passed in callback.
@@ -59,6 +69,9 @@ class OfflinePageMetadataStore {
// Resets the store.
virtual void Reset(const ResetCallback& callback) = 0;
+
+ // Gets the store state.
+ virtual StoreState state() const = 0;
};
} // namespace offline_pages
« no previous file with comments | « no previous file | components/offline_pages/offline_page_metadata_store_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698