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

Unified Diff: components/offline_pages/offline_page_metadata_store_sql.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_sql.h
diff --git a/components/offline_pages/offline_page_metadata_store_sql.h b/components/offline_pages/offline_page_metadata_store_sql.h
index c26cae8fb3e6653ee5f3224d2cda2cc55115607c..c25eb1ee72c30c1430cbc606d49d828d66eee94a 100644
--- a/components/offline_pages/offline_page_metadata_store_sql.h
+++ b/components/offline_pages/offline_page_metadata_store_sql.h
@@ -58,6 +58,7 @@ class OfflinePageMetadataStoreSQL : public OfflinePageMetadataStore {
~OfflinePageMetadataStoreSQL() override;
// Implementation methods.
+ void Initialize(const InitializeCallback& callback) override;
void GetOfflinePages(const LoadCallback& callback) override;
void AddOfflinePage(const OfflinePageItem& offline_page,
const AddCallback& callback) override;
@@ -65,19 +66,19 @@ class OfflinePageMetadataStoreSQL : public OfflinePageMetadataStore {
const UpdateCallback& callback) override;
void RemoveOfflinePages(const std::vector<int64_t>& offline_ids,
const UpdateCallback& callback) override;
- void Reset(const ResetCallback& callback) override;
+ void Reset(const InitializeCallback& callback) override;
StoreState state() const override;
// Helper function used to force incorrect state for testing purposes.
void SetStateForTesting(StoreState state, bool reset_db);
private:
- // Used to initialize DB connection.
- void OpenConnection();
- void OnOpenConnectionDone(StoreState state);
+ // Used to conclude opening DB connection.
+ void OnOpenConnectionDone(const InitializeCallback& callback,
+ StoreState state);
// Used to reset DB connection.
- void OnResetDone(const ResetCallback& callback, StoreState state);
+ void OnResetDone(const InitializeCallback& callback, StoreState state);
fgorski 2016/11/14 21:59:47 needs to be removed.
fgorski 2016/11/14 22:24:09 Done.
// Helper function that checks whether a valid DB connection is present.
// Returns true if valid connection is present, otherwise it returns false and

Powered by Google App Engine
This is Rietveld 408576698