Commit ba990717 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Don't update item URL if it is the one being restored

This CL changes the update of the item's URL when the WebView URL is
changed. If the new WebView URL is different from the URL of the item
but is the URL associated with the session restoration of this URL,
the URL of the item is no longer updated.

Fixed: 1139289
Change-Id: Id3b31bfedeb6e84bc0527f642fa424e7f81381dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549620Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829605}
parent 140dd339
......@@ -303,8 +303,18 @@ using web::wk_navigation_util::IsPlaceholderUrl;
DCHECK(!self.navigationManagerImpl->GetPendingItem());
currentItem = self.navigationManagerImpl->GetLastCommittedItem();
}
if (currentItem && webViewURL != currentItem->GetURL())
currentItem->SetURL(webViewURL);
if (currentItem && webViewURL != currentItem->GetURL()) {
BOOL isRestoredURL = NO;
if (base::FeatureList::IsEnabled(web::features::kUseJSForErrorPage) &&
web::wk_navigation_util::IsRestoreSessionUrl(webViewURL)) {
GURL restoredURL;
web::wk_navigation_util::ExtractTargetURL(webViewURL, &restoredURL);
isRestoredURL = restoredURL == currentItem->GetURL();
}
if (!isRestoredURL)
currentItem->SetURL(webViewURL);
}
[self.delegate navigationObserver:self
URLDidChangeWithoutDocumentChange:URL];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment