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..1bf9ad3e1474173df865c0c6dd6afb76803a15f6 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); |
@@ -3247,13 +3240,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 |