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

Unified Diff: ios/chrome/browser/reading_list/reading_list_web_state_observer.mm

Issue 2762113002: Reading List iOS: Adapt loading offline for new reload process (Closed)
Patch Set: rebase Created 3 years, 9 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 | ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/reading_list_web_state_observer.mm
diff --git a/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm b/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm
index c204d771ba2961340b3e39cb89d86946c01a6899..0ca54adae018555d354449622a0646e3f43d9308 100644
--- a/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm
+++ b/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm
@@ -295,8 +295,14 @@ void ReadingListWebStateObserver::LoadOfflineReadingListEntry() {
item = navigationManager->GetLastCommittedItem();
item->SetURL(url);
item->SetVirtualURL(pending_url_);
- navigationManager->Reload(web::ReloadType::NORMAL,
- false /*check_for_repost*/);
+ // It is not possible to call |navigationManager->Reload| at that point as
+ // an error page is currently displayed.
+ // Calling Reload will eventually call |ErrorPageContent reload| which
+ // simply loads |pending_url_| and will erase the distilled_url.
+ // Instead, go to the index that will branch further in the reload stack
+ // and avoid this situation.
+ navigationManager->GoToIndex(
+ navigationManager->GetLastCommittedItemIndex());
} else if (navigationManager->GetPendingItemIndex() != -1 &&
navigationManager->GetItemAtIndex(
navigationManager->GetPendingItemIndex()) == item) {
« no previous file with comments | « no previous file | ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698