Commit adbc74f7 authored by Arthur Hemery's avatar Arthur Hemery Committed by Commit Bot

Navigation: Fix edge case cancel with NavigationClient on.

AbortClientNavigation() seems to always be coupled with a "stop all
document loaders". Stopping all document loaders has the effect to
cancel the client side navigation for PerMojoNavigationInterface
feature on.
Therefore it seemed to work to simply make AbortClientNavigation a
no-op for the NavigationClient path.

A certain race condition could cause the RenderFrameImpl to run
AbortClientNavigation() while the NavigationClient interface is not
yet held by the DocumentLoader. In this case, the no-op is not
sufficient and we need to do a manual reset.

This is done in this patch.

Bug: 784904
Change-Id: I0a07127f72f9cc222392c64478c743153b63f964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1608743Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659012}
parent 5a6639a6
...@@ -5010,8 +5010,11 @@ void RenderFrameImpl::AbortClientNavigation() { ...@@ -5010,8 +5010,11 @@ void RenderFrameImpl::AbortClientNavigation() {
browser_side_navigation_pending_ = false; browser_side_navigation_pending_ = false;
sync_navigation_callback_.Cancel(); sync_navigation_callback_.Cancel();
mhtml_body_loader_client_.reset(); mhtml_body_loader_client_.reset();
if (!IsPerNavigationMojoInterfaceEnabled()) if (!IsPerNavigationMojoInterfaceEnabled()) {
Send(new FrameHostMsg_AbortNavigation(routing_id_)); Send(new FrameHostMsg_AbortNavigation(routing_id_));
} else {
navigation_client_impl_.reset();
}
} }
void RenderFrameImpl::DidChangeSelection(bool is_empty_selection) { void RenderFrameImpl::DidChangeSelection(bool is_empty_selection) {
......
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