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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2910783002: Adds Lo-Fi fallback support for new Data Reduction Proxy protocol. (Closed)
Patch Set: Added unittest for server providing lite page and also directing page-policy Created 3 years, 6 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 67ae44acdd11aee6bfad43f2c7fc953dcc39548b..7444b4313fb7fb560d0b01385e64b4f76c96aed4 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -132,6 +132,7 @@
#include "content/renderer/pepper/pepper_audio_controller.h"
#include "content/renderer/pepper/plugin_instance_throttler_impl.h"
#include "content/renderer/presentation/presentation_dispatcher.h"
+#include "content/renderer/previews_state_helper.h"
#include "content/renderer/push_messaging/push_messaging_client.h"
#include "content/renderer/render_frame_proxy.h"
#include "content/renderer/render_process.h"
@@ -3607,10 +3608,10 @@ void RenderFrameImpl::DidCommitProvisionalLoad(
// main frame documents. Subframes inherit from the main frame and should not
// change at commit time.
if (is_main_frame_ && !navigation_state->WasWithinSameDocument()) {
- previews_state_ =
- extra_data ? extra_data->previews_state() : PREVIEWS_OFF;
-
+ previews_state_ = PREVIEWS_OFF;
if (extra_data) {
+ previews_state_ = UpdatePreviewsStateFromMainFrameResponse(
+ extra_data->previews_state(), web_url_response);
nasko 2017/06/09 22:51:34 Why not pass in only web_url_response? The extra_d
dougarnett 2017/06/10 00:07:27 I explored this a bit. I still need to determine e
nasko 2017/06/12 17:38:50 Thanks for looking into this. It is fine to stay a
effective_connection_type_ =
EffectiveConnectionTypeToWebEffectiveConnectionType(
extra_data->effective_connection_type());
@@ -4046,8 +4047,7 @@ bool RenderFrameImpl::ShouldUseClientLoFiForRequest(
if (!(previews_state_ & CLIENT_LOFI_ON))
return false;
- if (previews_state_ &
- (SERVER_LITE_PAGE_ON | PREVIEWS_OFF | PREVIEWS_NO_TRANSFORM)) {
+ if (previews_state_ & (PREVIEWS_OFF | PREVIEWS_NO_TRANSFORM)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698