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

Unified Diff: components/offline_pages/offline_page_test_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_test_store.h
diff --git a/components/offline_pages/offline_page_test_store.h b/components/offline_pages/offline_page_test_store.h
index 7464bdd15e07d1e3077381cd13d131bf018c29cd..3497544cfa73cfc5327b171f778ef26be9acacee 100644
--- a/components/offline_pages/offline_page_test_store.h
+++ b/components/offline_pages/offline_page_test_store.h
@@ -26,7 +26,8 @@ class OfflinePageTestStore : public OfflinePageMetadataStore {
enum class TestScenario {
SUCCESSFUL,
WRITE_FAILED,
- LOAD_FAILED,
+ LOAD_FAILED_RESET_SUCCESS,
+ LOAD_FAILED_RESET_FAILED,
REMOVE_FAILED,
};
@@ -36,6 +37,7 @@ class OfflinePageTestStore : public OfflinePageMetadataStore {
~OfflinePageTestStore() override;
// OfflinePageMetadataStore overrides:
+ void Initialize(const InitializeCallback& callback) override;
void GetOfflinePages(const LoadCallback& callback) override;
void AddOfflinePage(const OfflinePageItem& offline_page,
const AddCallback& callback) override;
@@ -43,7 +45,7 @@ class OfflinePageTestStore : 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;
void UpdateLastAccessTime(int64_t offline_id,
@@ -63,6 +65,7 @@ class OfflinePageTestStore : public OfflinePageMetadataStore {
OfflinePageItem last_saved_page_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
TestScenario scenario_;
+ StoreState store_state_;
std::map<int64_t, OfflinePageItem> offline_pages_;

Powered by Google App Engine
This is Rietveld 408576698