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

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

Issue 1307103004: Fixing WKWebView QuickBack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revised fix Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
index 0d1845039df51e0c8d9b331d76f3f73df2746cab..94797002ebab74f59c0a800b4abdd075398c690c 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -449,19 +449,17 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
[self loadRequest:[self requestForCurrentNavigationItem]];
};
- // If there is no corresponding WKBackForwardListItem, fall back to
- // the standard loading mechanism.
+ // If there is no corresponding WKBackForwardListItem, or the item is not in
+ // the current WKWebView's back-forward list, we can only fall back to the
Eugene But (OOO till 7-30) 2015/09/14 21:48:55 NIT: please do not use we in the comments.
+ // default navigation mechanism.
web::WKBackForwardListItemHolder* holder =
[self currentBackForwardListItemHolder];
- if (!holder->back_forward_list_item()) {
+ if (!holder->back_forward_list_item() ||
+ ![self isBackForwardListItemValid:holder->back_forward_list_item()]) {
defaultNavigationBlock();
return;
}
- // The current back-forward list item MUST be in the WKWebView's back-forward
- // list to be valid.
- DCHECK([self isBackForwardListItemValid:holder->back_forward_list_item()]);
-
ProceduralBlock webViewNavigationBlock = ^{
// If the current navigation URL is the same as the URL of the visible
// page, that means the user requested a reload. |goToBackForwardListItem|
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698