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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2690913003: Revert "Updated ownership of NavigationItems within CRWSessionController." (Closed)
Patch Set: Revert olivier's CLs Created 3 years, 10 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 | « ios/web/public/navigation_item_list.mm ('k') | ios/web/web_state/ui/crw_web_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index c695bf76f977afd25079aba11cdf90c0ca095d15..19a95a60e53e49fa95a2123711e9f9f759feb4a8 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2164,14 +2164,6 @@ - (void)goToItemAtIndex:(int)index {
[self webWillFinishHistoryNavigationFromEntry:fromEntry];
[self updateHTML5HistoryState];
} else {
- // TODO(crbug.com/691492): After discardNonCommittedItems, the item
- // pointed by |fromEntry| may not be valid anymore.
- // Set |fromEntry| to nil to avoid crash whan using the item.
- // Remove when the fix is not needed anymore.
- if ([fromEntry isEqual:sessionController.transientEntry] ||
- [fromEntry isEqual:sessionController.pendingEntry]) {
- fromEntry = nil;
- }
[sessionController discardNonCommittedItems];
[sessionController setPendingItemIndex:index];
@@ -2409,10 +2401,7 @@ - (CRWPassKitDownloader*)passKitDownloader {
}
- (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry {
- // TODO(crbug.com/691492): Removing the DCHECK as |fromEntry| may be nil if
- // the pending entry was discarded.
- // Remove when the fix is not needed anymore.
- // DCHECK(fromEntry);
+ DCHECK(fromEntry);
[self updateDesktopUserAgentForEntry:self.currentSessionEntry
fromEntry:fromEntry];
[_delegate webWillFinishHistoryNavigationFromEntry:fromEntry];
« no previous file with comments | « ios/web/public/navigation_item_list.mm ('k') | ios/web/web_state/ui/crw_web_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698