Commit 50cffe3c authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Fix DCHECK in currentURLWithTrustLevel for NTP.

Special case trusted currentURLWithTrustLevel URLs that have been
rewritten to return the URL, and not the virtual URL. This fixes a
DCHECK when navigating forward from the NTP to an internal page.

Bug: 925776
Change-Id: I8d23b79eecd2f5902c726c7e2d8f9878969b9364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778962
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693213}
parent ffb54362
......@@ -667,7 +667,16 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
web::NavigationItem* item =
self.navigationManagerImpl
->GetLastCommittedItemInCurrentOrRestoredSession();
return item ? item->GetVirtualURL() : GURL::EmptyGURL();
if (item) {
// This special case is added for any app specific URLs that have been
// rewritten to about:// URLs.
if (item->GetURL().SchemeIs(url::kAboutScheme) &&
web::GetWebClient()->IsAppSpecificURL(item->GetVirtualURL())) {
return item->GetURL();
}
return item->GetVirtualURL();
}
return GURL::EmptyGURL();
}
- (void)reloadWithRendererInitiatedNavigation:(BOOL)rendererInitiated {
......
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