[Nav Experiment] Abort native URL navigation if new navigation starts
With LegacyNavigationManagerImpl, native URLs are loaded synchronously during the call to CRWWebController.loadCurrentURL, so it's impossible for another navigation to start before the native URL navigation finishes. With WKBasedNavigationManager, the call to loadCurrentURL triggers an placeholder navigation on the WKWebView, and the actual work to load the native URL happens when that placeholder navigation is finished. Since the placeholder navigation happens asynchronously, a new navigation (creating a new pending navigation item) can start before the placeholder navigation finishes. In this situation, when the placeholder navigation finishes, running its completion handler to load the native URL results in incorrect behavior and a DCHECK, since the current navigation item (the new one) no longer corresponds to that native URL navigation. This CL skips running the completion handler for a placeholder navigation when another navigation has started. This means that a WebStateObserver sees neither a DidStartNavigation call nor a DidFinishNavigation call for the native URL navigation. This fixes crashes in several tests when loading a URL after opening a new tab, when using WKBasedNavigationManager. Bug: 775645 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I88ce3f524ca4298ad5905430c12dca759a9b7202 Reviewed-on: https://chromium-review.googlesource.com/788173 Commit-Queue: Ali Juma <ajuma@chromium.org> Reviewed-by:Eugene But <eugenebut@chromium.org> Cr-Commit-Position: refs/heads/master@{#519382}
Showing
Please register or sign in to comment