Navigation: Introducing the NavigationClient mojo interface.
This CL introduces a new interface called NavigationClient,
implemented on the renderer side. This interface should allow to
solve a number of race conditions as well as enabling
other things. See the related BUG for more information on this.
As a first step we replace two IPCs by reworking BeginNavigation.
The idea is to send an interface pointer over BeginNavigation
to allow for further control of the navigation.
An important part of this CL is getting the proper lifetime for the
Interface. We think that provisional_document_loader_ in the
FrameLoader is a good candidate to own the binding. On the browser
side,the NavigationRequest is in charge of holding the interface
endpoint.
BeginNavigation gets a new parameter: the AssociatedPtrInfo of the
transmitted interface. FrameMsg_DroppedNavigation is replaced by the
browser closing the pipe. FrameHostMsg_AbortNavigation is replaced by
the renderer closing the pipe.
The new interface duplicates the CommitNavigation and
CommitFailedNavigation methods of the FrameNavigationControl interface.
These new methods are used instead of the old interface ones for
navigations that originated from a BeginNavigation. In future patches,
it will be a complete replacement for both renderer and browser
initiated navigations.
Note: This patch is fully behind the PerNavigationMojoInterface flag.
Please see
https://chromium-review.googlesource.com/c/chromium/src/+/1072469
for the trybot runs with the PerNavigationMojoInterface flag on.
Bug: 784904
Change-Id: Ifca1b3f6bdab1b3988f867c7cce44b7292e6668e
Reviewed-on: https://chromium-review.googlesource.com/881043
Commit-Queue: Arthur Hemery <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Camille Lamy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#562790}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index 82ab71a1..b97af70 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -90,11 +90,12 @@
void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node,
bool proceed,
const base::TimeTicks& proceed_time) override;
- void OnBeginNavigation(FrameTreeNode* frame_tree_node,
- const CommonNavigationParams& common_params,
- mojom::BeginNavigationParamsPtr begin_params,
- scoped_refptr<network::SharedURLLoaderFactory>
- blob_url_loader_factory) override;
+ void OnBeginNavigation(
+ FrameTreeNode* frame_tree_node,
+ const CommonNavigationParams& common_params,
+ mojom::BeginNavigationParamsPtr begin_params,
+ scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
+ mojom::NavigationClientAssociatedPtrInfo navigation_client) override;
void RestartNavigationAsCrossDocument(
std::unique_ptr<NavigationRequest> navigation_request) override;
void OnAbortNavigation(FrameTreeNode* frame_tree_node) override;