We've been seeing a lot of issues around the loading state tracking in the browser process (issue 789252, issue 786313). In order to fix them, I propose the following:
- remove the DidStart/StopLoading notifications for same-document navigations.
- change the meaning of RenderFrameHostImpl::is_loading to the current document is loading. (and not we have a navigation pending). Following that, we would compute that a FrameTreeNode is loading if its current RFH is loading or we have a NavigationRequest in the FTN or RFH. We would also set RFH to loading when a navigation commits.
- stop resetting the NavigationRequest when we receive a DidStopLoading message: this means that we should stop sending a DidStopLoading IPC when we drop a navigation. This will eventually be solved by the Mojo interface for navigations, but we can have a look at introducing a DroppedNavigation IPC in the meantime.
- remove the WebContentsDelegate::LoadingStateChanged method and have callers use the WebContentsObserver methods (this one is causing issue during tear down).
We might also want to improve the loading state tracking in the renderer process, as it's currently hard to understand how it's set in blink::ProgressTracker. I think it would make more sense for the is_loading info to be in the FrameLoader.
Comment 1 by arthurso...@chromium.org
, Feb 7 2018