Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 856862627ff46d8fe4bae0d3a0a1fa12f9217404..41e586a1067c8e855eda93c93c61c22c0c877b6a 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -40,7 +40,6 @@ |
#include "content/common/frame_messages.h" |
#include "content/common/frame_replication_state.h" |
#include "content/common/input_messages.h" |
-#include "content/common/navigation_params.h" |
#include "content/common/service_worker/service_worker_types.h" |
#include "content/common/site_isolation_policy.h" |
#include "content/common/swapped_out_messages.h" |
@@ -796,9 +795,10 @@ void RenderFrameImpl::SetWebFrame(blink::WebLocalFrame* web_frame) { |
frame_ = web_frame; |
} |
-void RenderFrameImpl::Initialize() { |
+void RenderFrameImpl::Initialize(LoFiState lofi_state) { |
is_subframe_ = !!frame_->parent(); |
is_local_root_ = !frame_->parent() || frame_->parent()->isWebRemoteFrame(); |
+ lofi_state_ = lofi_state; |
#if defined(ENABLE_PLUGINS) |
new PepperBrowserConnection(this); |
@@ -2218,7 +2218,7 @@ blink::WebFrame* RenderFrameImpl::createChildFrame( |
// Add the frame to the frame tree and initialize it. |
parent->appendChild(web_frame); |
- child_render_frame->Initialize(); |
+ child_render_frame->Initialize(lofi_state_); |
return web_frame; |
} |
@@ -2298,7 +2298,7 @@ void RenderFrameImpl::willClose(blink::WebFrame* frame) { |
FOR_EACH_OBSERVER(RenderFrameObserver, observers_, FrameWillClose()); |
FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), |
- FrameWillClose(frame)); |
+ FrameWillClose(frame, lofi_state_ == LOFI_ON)); |
} |
void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame, |
@@ -2690,6 +2690,12 @@ void RenderFrameImpl::didCommitProvisionalLoad( |
DocumentState::FromDataSource(frame->dataSource()); |
NavigationStateImpl* navigation_state = |
static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
+ WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse( |
+ frame->dataSource()->response()); |
+ if (extra_data && extra_data->is_lofi()) |
+ lofi_state_ = LOFI_ON; |
+ else |
+ lofi_state_ = LOFI_OFF; |
if (proxy_routing_id_ != MSG_ROUTING_NONE) { |
RenderFrameProxy* proxy = |
@@ -3344,6 +3350,10 @@ void RenderFrameImpl::willSendRequest( |
navigation_state->start_params().transferred_request_request_id); |
extra_data->set_service_worker_provider_id(provider_id); |
extra_data->set_stream_override(stream_override.Pass()); |
+ if (request.cachePolicy() == WebURLRequest::ReloadBypassingCache) |
davidben
2015/08/31 23:43:24
Why isn't this coming from the navigation paramete
megjablon
2015/09/02 21:25:42
This is for the single image and page reloads whic
davidben
2015/09/04 14:41:22
I see. This should at least have a TODO comment wi
megjablon
2015/09/09 20:54:16
Done.
|
+ extra_data->set_lofi_state(LOFI_OFF); |
+ else |
+ extra_data->set_lofi_state(lofi_state_); |
request.setExtraData(extra_data); |
// TODO(creis): Update prefetching to work with out-of-process iframes. |
@@ -4486,6 +4496,8 @@ void RenderFrameImpl::NavigateInternal( |
GetContentClient()->SetActiveURL(common_params.url); |
+ lofi_state_ = (LoFiState) request_params.lofi_state; |
+ |
// If this frame isn't in the same process as the main frame, it may naively |
// assume that this is the first navigation in the iframe, but this may not |
// actually be the case. Inform the frame's state machine if this frame has |