Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 094ebe88c06436458f2a162326fd408e02c635ef..ff2f29aef5c11d0d8f0b0814b311d8071ec3c247 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -3099,16 +3099,9 @@ void RenderFrameImpl::willSendRequest( |
} |
} |
- WebFrame* top_frame = frame->top(); |
- // TODO(nasko): Hack around asking about top-frame data source. This means |
- // for out-of-process iframes we are treating the current frame as the |
- // top-level frame, which is wrong. |
- if (!top_frame || top_frame->isWebRemoteFrame()) |
- top_frame = frame; |
- WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); |
- WebDataSource* top_data_source = top_frame->dataSource(); |
+ WebDataSource* provisional_data_source = frame->provisionalDataSource(); |
WebDataSource* data_source = |
- provisional_data_source ? provisional_data_source : top_data_source; |
+ provisional_data_source ? provisional_data_source : frame->dataSource(); |
DocumentState* document_state = DocumentState::FromDataSource(data_source); |
DCHECK(document_state); |
@@ -3117,8 +3110,7 @@ void RenderFrameImpl::willSendRequest( |
NavigationStateImpl* navigation_state = |
static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
ui::PageTransition transition_type = navigation_state->GetTransitionType(); |
- WebDataSource* frame_ds = frame->provisionalDataSource(); |
Charlie Reis
2015/07/09 17:40:11
Noticed this was redundant now.
|
- if (frame_ds && frame_ds->isClientRedirect()) { |
+ if (provisional_data_source && provisional_data_source->isClientRedirect()) { |
transition_type = ui::PageTransitionFromInt( |
transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
} |
@@ -3247,13 +3239,17 @@ void RenderFrameImpl::willSendRequest( |
extra_data->set_stream_override(stream_override.Pass()); |
request.setExtraData(extra_data); |
- DocumentState* top_document_state = |
- DocumentState::FromDataSource(top_data_source); |
- if (top_document_state) { |
- // TODO(gavinp): separate out prefetching and prerender field trials |
- // if the rel=prerender rel type is sticking around. |
- if (request.requestContext() == WebURLRequest::RequestContextPrefetch) |
- top_document_state->set_was_prefetcher(true); |
+ // TODO(creis): Update prefetching to work with out-of-process iframes. |
+ WebFrame* top_frame = frame->top(); |
+ if (top_frame && top_frame->isWebLocalFrame()) { |
+ DocumentState* top_document_state = |
+ DocumentState::FromDataSource(top_frame->dataSource()); |
+ if (top_document_state) { |
+ // TODO(gavinp): separate out prefetching and prerender field trials |
+ // if the rel=prerender rel type is sticking around. |
+ if (request.requestContext() == WebURLRequest::RequestContextPrefetch) |
+ top_document_state->set_was_prefetcher(true); |
+ } |
} |
// This is an instance where we embed a copy of the routing id |
@@ -4420,8 +4416,12 @@ void RenderFrameImpl::NavigateInternal( |
pending_navigation_params_.reset( |
new NavigationParams(common_params, start_params, request_params)); |
- // Create parameters for a standard navigation. |
- blink::WebFrameLoadType load_type = blink::WebFrameLoadType::Standard; |
+ // Create parameters for a standard navigation, indicating whether it should |
+ // replace the current NavigationEntry. |
+ blink::WebFrameLoadType load_type = |
+ start_params.should_replace_current_entry ? |
+ blink::WebFrameLoadType::RedirectWithLockedBackForwardList : |
Charlie Reis
2015/07/09 17:40:11
This is the fix for https://crbug.com/317872, and
|
+ blink::WebFrameLoadType::Standard; |
bool should_load_request = false; |
WebHistoryItem item_for_history_navigation; |
WebURLRequest request = CreateURLRequestForNavigation( |