Commit 2c07baee authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

[ios] Remove DCHECKs related to _lastRegisteredRequestURL.

This is step 3 to removing _lastRegisteredRequestURL from
CRWWebController. This CL has no functional change.

Bug: 789993,792515
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ia415197025b4b3461fc807602e17063a753c39c1
Reviewed-on: https://chromium-review.googlesource.com/812446
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522460}
parent 2c1b3d06
......@@ -1991,28 +1991,6 @@ registerLoadRequestForURL:(const GURL&)requestURL
[self optOutScrollsToTopForSubviews];
DCHECK((currentURL == _lastRegisteredRequestURL) || // latest navigation
// previous navigation
![[_navigationStates lastAddedNavigation] isEqual:navigation] ||
// invalid URL load
(!_lastRegisteredRequestURL.is_valid() &&
_documentURL.spec() == url::kAboutBlankURL) ||
// about URL was changed by WebKit (e.g. about:newtab -> about:blank)
(_lastRegisteredRequestURL.scheme() == url::kAboutScheme &&
currentURL.spec() == url::kAboutBlankURL) ||
// In a very unfortunate edge case, window.history.didReplaceState
// message can arrive between the |webView:didCommitNavigation| and
// |webView:didFinishNavigation| callbacks of the page that contains
// the replaceState call. In this case, _lastRegisteredRequestURL and
// webView.URL are already updated to the replace state URL, but
// currentURL is still the old URL. See crbug.com/788464.
// TODO(crbug.com/788465): simplify history state handling to avoid
// this hack.
(_lastRegisteredRequestURL == net::GURLWithNSURL(_webView.URL)))
<< std::endl
<< "currentURL = [" << currentURL << "]" << std::endl
<< "_lastRegisteredRequestURL = [" << _lastRegisteredRequestURL << "]";
// Perform post-load-finished updates.
[self didFinishWithURL:currentURL loadSuccess:loadSuccess];
......@@ -4556,10 +4534,6 @@ registerLoadRequestForURL:(const GURL&)requestURL
BOOL isLastNavigation =
!navigation ||
[[_navigationStates lastAddedNavigation] isEqual:navigation];
DCHECK(_documentURL == _lastRegisteredRequestURL || // latest navigation
!isLastNavigation || // previous navigation
(!_lastRegisteredRequestURL.is_valid() && // invalid URL load
_documentURL.spec() == url::kAboutBlankURL));
// Update HTTP response headers.
_webStateImpl->UpdateHttpResponseHeaders(_documentURL);
......
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