Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 334cdbae23ed6bdebd46b145e896f50eaf807c91..47ee33bdcd493625f2116a749c87f48ddef4b6b9 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -1587,6 +1587,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { |
IPC_MESSAGE_HANDLER(FrameMsg_ExtractSmartClipData, OnExtractSmartClipData) |
IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
+ IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigationNetworkService, |
+ OnCommitNavigationNetworkService) |
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
OnSetFrameOwnerProperties) |
@@ -5226,6 +5228,38 @@ void RenderFrameImpl::OnCommitNavigation( |
} |
// PlzNavigate |
+void RenderFrameImpl::OnCommitNavigationNetworkService( |
+ const ResourceResponseHead& response, |
+ mojo::DataPipeConsumerHandle handle, |
+ const CommonNavigationParams& common_params, |
+ const RequestNavigationParams& request_params) { |
+ CHECK(IsBrowserSideNavigationEnabled()); |
+ // This will override the url requested by the WebURLLoader, as well as |
+ // provide it with the response to the request. |
+ std::unique_ptr<StreamOverrideParameters> stream_override( |
+ new StreamOverrideParameters()); |
+ stream_override->consumer_handle = mojo::ScopedDataPipeConsumerHandle(handle); |
+ stream_override->response = response; |
+ stream_override->redirects = request_params.redirects; |
+ stream_override->redirect_responses = request_params.redirect_response; |
+ stream_override->redirect_infos = request_params.redirect_infos; |
+ |
+ // If the request was initiated in the context of a user gesture then make |
+ // sure that the navigation also executes in the context of a user gesture. |
+ std::unique_ptr<blink::WebScopedUserGesture> gesture( |
+ request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_) |
+ : nullptr); |
+ |
+ browser_side_navigation_pending_ = false; |
+ |
+ NavigateInternal(common_params, StartNavigationParams(), request_params, |
+ std::move(stream_override)); |
+ |
+ // Don't add code after this since NavigateInternal may have destroyed this |
+ // RenderFrameImpl. |
+} |
+ |
+// PlzNavigate |
void RenderFrameImpl::OnFailedNavigation( |
const CommonNavigationParams& common_params, |
const RequestNavigationParams& request_params, |