OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) | 1580 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) |
1581 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1581 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
1582 OnTextSurroundingSelectionRequest) | 1582 OnTextSurroundingSelectionRequest) |
1583 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1583 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
1584 OnSetAccessibilityMode) | 1584 OnSetAccessibilityMode) |
1585 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, | 1585 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, |
1586 OnSnapshotAccessibilityTree) | 1586 OnSnapshotAccessibilityTree) |
1587 IPC_MESSAGE_HANDLER(FrameMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1587 IPC_MESSAGE_HANDLER(FrameMsg_ExtractSmartClipData, OnExtractSmartClipData) |
1588 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 1588 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
1589 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1589 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1590 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigationNetworkService, |
| 1591 OnCommitNavigationNetworkService) |
1590 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1592 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
1591 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, | 1593 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
1592 OnSetFrameOwnerProperties) | 1594 OnSetFrameOwnerProperties) |
1593 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) | 1595 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) |
1594 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) | 1596 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) |
1595 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, | 1597 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, |
1596 OnTextTrackSettingsChanged) | 1598 OnTextTrackSettingsChanged) |
1597 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) | 1599 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) |
1598 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) | 1600 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) |
1599 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, | 1601 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, |
(...skipping 3619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5219 browser_side_navigation_pending_ = false; | 5221 browser_side_navigation_pending_ = false; |
5220 | 5222 |
5221 NavigateInternal(common_params, StartNavigationParams(), request_params, | 5223 NavigateInternal(common_params, StartNavigationParams(), request_params, |
5222 std::move(stream_override)); | 5224 std::move(stream_override)); |
5223 | 5225 |
5224 // Don't add code after this since NavigateInternal may have destroyed this | 5226 // Don't add code after this since NavigateInternal may have destroyed this |
5225 // RenderFrameImpl. | 5227 // RenderFrameImpl. |
5226 } | 5228 } |
5227 | 5229 |
5228 // PlzNavigate | 5230 // PlzNavigate |
| 5231 void RenderFrameImpl::OnCommitNavigationNetworkService( |
| 5232 const ResourceResponseHead& response, |
| 5233 mojo::DataPipeConsumerHandle handle, |
| 5234 const CommonNavigationParams& common_params, |
| 5235 const RequestNavigationParams& request_params) { |
| 5236 CHECK(IsBrowserSideNavigationEnabled()); |
| 5237 // This will override the url requested by the WebURLLoader, as well as |
| 5238 // provide it with the response to the request. |
| 5239 std::unique_ptr<StreamOverrideParameters> stream_override( |
| 5240 new StreamOverrideParameters()); |
| 5241 stream_override->consumer_handle = mojo::ScopedDataPipeConsumerHandle(handle); |
| 5242 stream_override->response = response; |
| 5243 stream_override->redirects = request_params.redirects; |
| 5244 stream_override->redirect_responses = request_params.redirect_response; |
| 5245 stream_override->redirect_infos = request_params.redirect_infos; |
| 5246 |
| 5247 // If the request was initiated in the context of a user gesture then make |
| 5248 // sure that the navigation also executes in the context of a user gesture. |
| 5249 std::unique_ptr<blink::WebScopedUserGesture> gesture( |
| 5250 request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_) |
| 5251 : nullptr); |
| 5252 |
| 5253 browser_side_navigation_pending_ = false; |
| 5254 |
| 5255 NavigateInternal(common_params, StartNavigationParams(), request_params, |
| 5256 std::move(stream_override)); |
| 5257 |
| 5258 // Don't add code after this since NavigateInternal may have destroyed this |
| 5259 // RenderFrameImpl. |
| 5260 } |
| 5261 |
| 5262 // PlzNavigate |
5229 void RenderFrameImpl::OnFailedNavigation( | 5263 void RenderFrameImpl::OnFailedNavigation( |
5230 const CommonNavigationParams& common_params, | 5264 const CommonNavigationParams& common_params, |
5231 const RequestNavigationParams& request_params, | 5265 const RequestNavigationParams& request_params, |
5232 bool has_stale_copy_in_cache, | 5266 bool has_stale_copy_in_cache, |
5233 int error_code) { | 5267 int error_code) { |
5234 DCHECK(IsBrowserSideNavigationEnabled()); | 5268 DCHECK(IsBrowserSideNavigationEnabled()); |
5235 bool is_reload = | 5269 bool is_reload = |
5236 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type); | 5270 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type); |
5237 RenderFrameImpl::PrepareRenderViewForNavigation( | 5271 RenderFrameImpl::PrepareRenderViewForNavigation( |
5238 common_params.url, request_params); | 5272 common_params.url, request_params); |
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6971 policy(info.default_policy), | 7005 policy(info.default_policy), |
6972 replaces_current_history_item(info.replaces_current_history_item), | 7006 replaces_current_history_item(info.replaces_current_history_item), |
6973 history_navigation_in_new_child_frame( | 7007 history_navigation_in_new_child_frame( |
6974 info.is_history_navigation_in_new_child_frame), | 7008 info.is_history_navigation_in_new_child_frame), |
6975 client_redirect(info.is_client_redirect), | 7009 client_redirect(info.is_client_redirect), |
6976 cache_disabled(info.is_cache_disabled), | 7010 cache_disabled(info.is_cache_disabled), |
6977 form(info.form), | 7011 form(info.form), |
6978 source_location(info.source_location) {} | 7012 source_location(info.source_location) {} |
6979 | 7013 |
6980 } // namespace content | 7014 } // namespace content |
OLD | NEW |