Commit 79a047d0 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Be more cautious with pending navigation when cancelling load

When a page load is cancelled, the pending navigation shouldn't
necessarly be discarded because another navigation could be the current
pending navigation (if there is a delay).
This CL makes sure to check that the cancelled navigation is the
pending navigation before discarding the pending navigation.

Bug: 1007243
Change-Id: Iae01e31bea3e40ae4ff08f1dbcc4a28c9f70198c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837931Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702874}
parent 6b46d4c4
...@@ -1788,7 +1788,11 @@ void ReportOutOfSyncURLInDidStartProvisionalNavigation( ...@@ -1788,7 +1788,11 @@ void ReportOutOfSyncURLInDidStartProvisionalNavigation(
std::unique_ptr<web::NavigationContextImpl> navigationContext = std::unique_ptr<web::NavigationContextImpl> navigationContext =
[self.navigationStates removeNavigation:navigation]; [self.navigationStates removeNavigation:navigation];
[self loadCancelled]; [self loadCancelled];
self.navigationManagerImpl->DiscardNonCommittedItems(); web::NavigationItemImpl* item = web::GetItemWithUniqueID(
self.navigationManagerImpl, navigationContext.get());
if (self.navigationManagerImpl->GetPendingItem() == item) {
self.navigationManagerImpl->DiscardNonCommittedItems();
}
[self.legacyNativeContentController [self.legacyNativeContentController
handleCancelledErrorForContext:navigationContext.get()]; handleCancelledErrorForContext:navigationContext.get()];
......
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