Commit 2d0392dc authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

Revert "[Nav Experiment] Skip SSL status update when webview is loading."

This reverts commit 9441c306.

Reason for revert: Breaks ExternalURLSSLTestCase/testMixedContentWarning in the downstream tree. 
 https://browsingtest.appspot.com/mixedContent.html does not show a mixed content warning.

Original change's description:
> [Nav Experiment] Skip SSL status update when webview is loading.
> 
> -webViewSecurityFeaturesDidChange is meant to update the SSL status of
> the last committed item. With WKBasedNavigationManager, on a back/forard
> navigation, there exists a small window between web view starts loading
> and -webView:didStartProvisionalNavigation is triggered that
> WKBasedNavigationManager::GetLastCommittedItem() returns the pending
> item instead of the last committed item.
> -updateSSLStatusForCurrentNavigationItem must not be called in this
> window, otherwise the wrong navigation item will be used.
> 
> Bug: 842151
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
> Change-Id: I57eb96f74c3a6a133b1fdad6559de093f5d125c5
> Reviewed-on: https://chromium-review.googlesource.com/1141054
> Commit-Queue: Danyao Wang <danyao@chromium.org>
> Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#575803}

TBR=kkhorimoto@chromium.org,danyao@chromium.org

Change-Id: Ia764eeca4fcb26cc3cf9cd8778fe4cedb5e98c3f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 842151
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/1141384Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575896}
parent 07997f74
...@@ -4985,21 +4985,9 @@ registerLoadRequestForURL:(const GURL&)requestURL ...@@ -4985,21 +4985,9 @@ registerLoadRequestForURL:(const GURL&)requestURL
} }
- (void)webViewSecurityFeaturesDidChange { - (void)webViewSecurityFeaturesDidChange {
if (self.loadPhase == web::LOAD_REQUESTED || _webView.isLoading) { if (self.loadPhase == web::LOAD_REQUESTED) {
// Do not update SSL Status for pending load. It will be updated in // Do not update SSL Status for pending load. It will be updated in
// |webView:didCommitNavigation:| callback. // |webView:didCommitNavigation:| callback.
//
// The second condition is important because on a back/forward navigation,
// WKBackForwardList.currentItem is already updated to the pending item when
// _webView.isLoading becomes true, but WKBasedNavigationManager hasn't yet
// updated its pending item (since |webView:didStartProvisionalNavigation|
// is not yet triggered). In this small window, the navigation item returned
// by GetLastCommittedItem() is actually the pending item. Early return to
// avoid exposing this inconsistent state to users outside of //ios/web.
// See http://crbug.com/842151 for a bug caused by this scenario.
// |updateSSLStatusForCurrentNavigationItem| is called again in
// |webViewLoadingStateDidChange|, so the SSL status of the committed item
// will be eventually updated.
return; return;
} }
[self updateSSLStatusForCurrentNavigationItem]; [self updateSSLStatusForCurrentNavigationItem];
......
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