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

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

Issue 2898633003: Mark pending item as created from hash change if necessary. (Closed)
Patch Set: Created 3 years, 7 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_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 afdb77c98861e546d87dddd7d88a9c488cd20ee7..2828338a4422e4a3d962537d47998809b7aa6433 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1862,6 +1862,18 @@ registerLoadRequestForURL:(const GURL&)requestURL
params.url, params.referrer, params.transition_type,
navigationInitiationType, params.user_agent_override_option);
+ // Mark pending item as created from hash change if necessary. This is needed
+ // because window.hashchange message may not arrive on time.
+ web::NavigationItemImpl* pendingItem = self.sessionController.pendingItem;
+ if (pendingItem) {
+ GURL lastCommittedURL = _webStateImpl->GetLastCommittedURL();
+ GURL pendingURL = pendingItem->GetURL();
+ if (lastCommittedURL != pendingURL &&
+ lastCommittedURL.EqualsIgnoringRef(pendingURL)) {
+ pendingItem->SetIsCreatedFromHashChange(true);
+ }
+ }
+
web::NavigationItemImpl* addedItem = self.currentNavItem;
DCHECK(addedItem);
if (params.extra_headers)
« 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