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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2642793005: Create a Lite Page bit for previews and fallback to Lo-Fi (Closed)
Patch Set: remove unused frame_messages.h code Created 3 years, 10 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/public/common/previews_state.h ('k') | third_party/WebKit/public/platform/WebURLRequest.h » ('j') | 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 4af9b671725620814b3f5d10384a881f4c68d83a..a8cbf916c69425bc24c1ac4e78c872de866c368a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3581,14 +3581,24 @@ void RenderFrameImpl::didCommitProvisionalLoad(
DocumentState::FromDataSource(frame->dataSource());
NavigationStateImpl* navigation_state =
static_cast<NavigationStateImpl*>(document_state->navigation_state());
+ const WebURLResponse& web_url_response = frame->dataSource()->response();
WebURLResponseExtraDataImpl* extra_data =
- GetExtraDataFromResponse(frame->dataSource()->response());
+ GetExtraDataFromResponse(web_url_response);
// Only update the PreviewsState and effective connection type states for new
// main frame documents. Subframes inherit from the main frame and should not
// change at commit time.
if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
previews_state_ =
extra_data ? extra_data->previews_state() : PREVIEWS_OFF;
+
+ // Set lite pages off if a lite page was not loaded for the main frame.
+ if (web_url_response
+ .httpHeaderField(
+ WebString::fromUTF8(kChromeProxyContentTransformHeader))
+ .utf8() != kChromeProxyLitePageDirective) {
+ previews_state_ &= ~(SERVER_LITE_PAGE_ON);
+ }
+
if (extra_data) {
effective_connection_type_ =
EffectiveConnectionTypeToWebEffectiveConnectionType(
« no previous file with comments | « content/public/common/previews_state.h ('k') | third_party/WebKit/public/platform/WebURLRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698