Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1225593003: OOPIF: Fix willSendRequest in A-B-A nested case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop location.replace fixes for now. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c258bda6f3114d985e70adcd52b02a32fed32075..3c410deccac0c81f3e443bee5a076245e64de97e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3155,16 +3155,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);
@@ -3173,8 +3166,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();
- 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);
}
@@ -3303,13 +3295,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
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698