Commit c119f150 authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

[Nav Experiment] Fix crash in ErrorPageTestCase.

If a new navigation has started before |webView:didFinishNavigation|
arrives, early exit and stop processing.

Bug: 851708
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Iea6ed9be60a547bc3fc2ee5bad6104b3a9eaef40
Reviewed-on: https://chromium-review.googlesource.com/1097564
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566566}
parent 762a2554
......@@ -4803,15 +4803,18 @@ registerLoadRequestForURL:(const GURL&)requestURL
if (IsPlaceholderUrl(webViewURL)) {
GURL originalURL = ExtractUrlFromPlaceholderUrl(webViewURL);
if (self.currentNavItem != item &&
self.currentNavItem->GetVirtualURL() != originalURL) {
// The |didFinishNavigation| callback can arrive after another
// navigation has started. Abort in this case.
return;
}
if (item->GetURL() == webViewURL) {
// Current navigation item is restored from a placeholder URL as part
// of session restoration. It is now safe to update the navigation
// item URL to the original app-specific URL.
item->SetURL(originalURL);
} else if (item->GetVirtualURL() != originalURL) {
// The |didFinishNavigation| callback can arrive after another
// navigation has started. Abort in this case.
return;
}
const bool isWebUIURL =
......
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