New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 837839 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 833517



Sign in to add a comment

DidStopLoading may be triggered before DidFinishNavigation

Project Member Reported by jianli@chromium.org, Apr 27 2018

Issue description

OS: Android

What steps will reproduce the problem?
(1) Setup a WIFI hotspot from an Android device. Make sure that this device is not connected to WIFI and other data network.
(2) In another Android device, navigate to a page, say google.com, and download it.
(3) Go to Downloads home, open the downloaded page. The offline copy should be loaded. You should see an Offline chip shown up in the omnibar.
(4) Connect to the hotspot. Reload current page.

What is the expected result?
The page should be reloaded with the Offline chip shown.

What happens instead?
The page is reloaded without the Offline chip. Note that we do load the offline page but the Offline chip is not shown (this can be verified by trying to select the input box. If a MHTML page is being loaded, the input box is disabled).


When we reload current page in step 4, a net error page is hit because we connect to a hotspot without the network activity. OfflinePageTabHelper::TryLoadingOfflinePageOnNetError detects that it is the net error code we want to handle and there is an offline page for it. So we reload current page with extra header to force loading the offline version. Then some risk condition happens in this navigation and causes DidStopLoading event to be sent before DidFinishNavigation. DidStopLoading causes RenderFrameHostImpl::OnDidStopLoading to clear navigation_request_. Then RenderFrameHostImpl::TakeNavigationHandleForCommit ends up with creating a new NavigationHandle.

As a result, we observe the following sequence of navigation events:
1) DidStartNavigation
2) DidStopLoading
3) DidFinishNavigation (NavigationHandle::HasCommitted returns false)
4) DidStartNavigation
5) DidFinishNavigation (NavigationHandle::HasCommitted returns true)

 

Comment 1 by jianli@chromium.org, Apr 27 2018

Blocking: 833517

Comment 2 by nasko@chromium.org, Apr 27 2018

Owner: clamy@chromium.org
Based on the sequence of navigation events, it looks like one of the known race conditions we have in the code today. Camille, can you look at this one to verify that it is indeed the DidStopLoading issue causing us to drop navigations?

Sign in to add a comment