Commit 9df4233f authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios/web] Relax GetCurrentURL DCHECK for placeholder URLs.

Sometimes after session restoration the NavigationItem URL is placeholder.
Because -currentURLWithTrustLevel:trust_level will return the virtualURL,
compare with a NavigationItem virtualURL as well here.

Change-Id: Ie189fdb435a43aa7ffffe41fdd9c62183b55e2e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887271
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710357}
parent b4f49ef1
......@@ -677,6 +677,7 @@ GURL WebStateImpl::GetCurrentURL(URLVerificationTrustLevel* trust_level) const {
if (item) {
if ([[web_controller_ nativeContentHolder].nativeController
respondsToSelector:@selector(virtualURL)] ||
wk_navigation_util::IsPlaceholderUrl(item->GetURL()) ||
item->error_retry_state_machine().state() ==
ErrorRetryState::kReadyToDisplayError) {
// For native content, or when webView.URL is a placeholder 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