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

Unified Diff: components/offline_pages/offline_page_model_impl.h

Issue 2384423003: [Offline pages] Resetting offline page metadata store if initial load fails (Closed)
Patch Set: Rebased and comments addressed Created 4 years, 2 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
Index: components/offline_pages/offline_page_model_impl.h
diff --git a/components/offline_pages/offline_page_model_impl.h b/components/offline_pages/offline_page_model_impl.h
index 194fa20695a13fdfdb627b243436964920ebc52c..431a33250e8b4f16d7951658a304ef4493b5ac09 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -152,9 +152,15 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
void CheckMetadataConsistency();
// Callback for loading pages from the offline page metadata store.
- void OnLoadDone(const base::TimeTicks& start_time,
- OfflinePageMetadataStore::LoadStatus load_status,
- const std::vector<OfflinePageItem>& offline_pages);
+ void OnGetOfflinePagesDoneForInit(
+ const base::TimeTicks& start_time,
+ StoreState store_state,
+ const std::vector<OfflinePageItem>& offline_pages);
+
+ // Attempts to reset the store.
+ bool MaybeResetStore(const base::TimeTicks& start_time);
+ // Callback for resetting the offline page metadata store.
+ void OnStoreResetDone(const base::TimeTicks& start_time, bool success);
// Steps for saving a page offline.
void OnCreateArchiveDone(const GURL& requested_url,
@@ -279,6 +285,9 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
// Logger to facilitate recording of events.
OfflinePageModelEventLogger offline_event_logger_;
+ // Remaining store reset attempts left. (To prevent infinite attempts.)
+ int store_reset_attempts_left_;
+
// Clock for getting time in testing code. The setter is responsible to reset
// it once it is not longer needed.
base::Clock* testing_clock_;

Powered by Google App Engine
This is Rietveld 408576698