| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index aaccc4354fb359f545106b1e21036860f2f98372..d7942cefb16026f494faa3b6bc0e1b6ae1c89060 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -504,7 +504,7 @@ CommonNavigationParams MakeCommonNavigationParams(
|
| return CommonNavigationParams(
|
| request->url(), referrer, extra_data->transition_type(),
|
| FrameMsg_Navigate_Type::NORMAL, true, should_replace_current_entry,
|
| - ui_timestamp, report_type, GURL(), GURL());
|
| + ui_timestamp, report_type, GURL(), GURL(), LOFI_UNSPECIFIED);
|
| }
|
|
|
| #if !defined(OS_ANDROID) || defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
|
| @@ -741,6 +741,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
|
| manifest_manager_(NULL),
|
| accessibility_mode_(AccessibilityModeOff),
|
| renderer_accessibility_(NULL),
|
| + is_using_lofi_(false),
|
| weak_factory_(this) {
|
| std::pair<RoutingIDFrameMap::iterator, bool> result =
|
| g_routing_id_frame_map.Get().insert(std::make_pair(routing_id_, this));
|
| @@ -815,6 +816,11 @@ void RenderFrameImpl::Initialize() {
|
| is_main_frame_ = !frame_->parent();
|
| is_local_root_ = is_main_frame_ || frame_->parent()->isWebRemoteFrame();
|
|
|
| + RenderFrameImpl* parent_frame = RenderFrameImpl::FromWebFrame(
|
| + frame_->parent());
|
| + if (parent_frame)
|
| + is_using_lofi_ = parent_frame->IsUsingLoFi();
|
| +
|
| bool is_tracing = false;
|
| TRACE_EVENT_CATEGORY_GROUP_ENABLED("navigation", &is_tracing);
|
| if (is_tracing) {
|
| @@ -2033,6 +2039,10 @@ void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level,
|
| devtools_agent_->AddMessageToConsole(level, message);
|
| }
|
|
|
| +bool RenderFrameImpl::IsUsingLoFi() const {
|
| + return is_using_lofi_;
|
| +}
|
| +
|
| // blink::WebFrameClient implementation ----------------------------------------
|
|
|
| blink::WebPlugin* RenderFrameImpl::createPlugin(
|
| @@ -2728,6 +2738,9 @@ void RenderFrameImpl::didCommitProvisionalLoad(
|
| DocumentState::FromDataSource(frame->dataSource());
|
| NavigationStateImpl* navigation_state =
|
| static_cast<NavigationStateImpl*>(document_state->navigation_state());
|
| + WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(
|
| + frame->dataSource()->response());
|
| + is_using_lofi_ = extra_data && extra_data->is_using_lofi();
|
|
|
| if (proxy_routing_id_ != MSG_ROUTING_NONE) {
|
| RenderFrameProxy* proxy =
|
| @@ -3388,6 +3401,14 @@ 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());
|
| + // TODO(megjablon): Set the navigation params for single image loads to
|
| + // LOFI_OFF and remove the dependency on ReloadBypassingCache.
|
| + if (request.cachePolicy() == WebURLRequest::ReloadBypassingCache)
|
| + extra_data->set_lofi_state(LOFI_OFF);
|
| + else if (is_main_frame_ && !navigation_state->request_committed())
|
| + extra_data->set_lofi_state(navigation_state->common_params().lofi_state);
|
| + else
|
| + extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF);
|
| request.setExtraData(extra_data);
|
|
|
| // TODO(creis): Update prefetching to work with out-of-process iframes.
|
|
|