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

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: 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 519f2b2b5d4b495a48fabc5d5295eef4c143d850..13e40cc0c0889f0cc7f4890541ffe0ae13944356 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -160,9 +160,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,
@@ -287,6 +293,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