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

Unified Diff: components/offline_pages/offline_page_metadata_store.h

Issue 2339693002: [Offline pages] Splitting Add and Update methods in OPMStore (Closed)
Patch Set: Addressing 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 b2e34e2516535f71314f9011d0fb245f96b93bf0..63a35e464bdcd448da68500251c49e7db293a62a 100644
--- a/components/offline_pages/offline_page_metadata_store.h
+++ b/components/offline_pages/offline_page_metadata_store.h
@@ -46,8 +46,17 @@ class OfflinePageMetadataStore {
FAILED_RESET,
};
+ // Statuses referring to actions taken on items in the store.
+ enum ItemActionStatus {
+ SUCCESS,
+ ALREADY_EXISTS,
+ DOESNT_EXIST,
+ STORE_ERROR,
+ };
+
typedef base::Callback<void(LoadStatus, const std::vector<OfflinePageItem>&)>
LoadCallback;
+ typedef base::Callback<void(ItemActionStatus)> AddCallback;
typedef base::Callback<void(bool)> UpdateCallback;
typedef base::Callback<void(bool)> ResetCallback;
@@ -57,10 +66,13 @@ class OfflinePageMetadataStore {
// Get all of the offline pages from the store.
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.
- virtual void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page,
- const UpdateCallback& callback) = 0;
+ // Asynchronously adds an offline page item metadata to the store.
+ virtual void AddOfflinePage(const OfflinePageItem& offline_page,
+ const AddCallback& callback) = 0;
+
+ // Asynchronously updates a set of offline page items in the store.
+ virtual void UpdateOfflinePages(const std::vector<OfflinePageItem>& pages,
+ const UpdateCallback& callback) = 0;
// Asynchronously removes offline page metadata from the store.
// Result of the update is passed in callback.
« 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