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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2642793005: Create a Lite Page bit for previews and fallback to Lo-Fi (Closed)
Patch Set: bengr comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit", 3593 "SessionRestore.SubFrameUniqueNameChangedBeforeFirstCommit",
3594 name_changed_before_first_commit_); 3594 name_changed_before_first_commit_);
3595 } 3595 }
3596 committed_first_load_ = true; 3596 committed_first_load_ = true;
3597 } 3597 }
3598 3598
3599 DocumentState* document_state = 3599 DocumentState* document_state =
3600 DocumentState::FromDataSource(frame->dataSource()); 3600 DocumentState::FromDataSource(frame->dataSource());
3601 NavigationStateImpl* navigation_state = 3601 NavigationStateImpl* navigation_state =
3602 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 3602 static_cast<NavigationStateImpl*>(document_state->navigation_state());
3603 const WebURLResponse& web_url_response = frame->dataSource()->response();
3603 WebURLResponseExtraDataImpl* extra_data = 3604 WebURLResponseExtraDataImpl* extra_data =
3604 GetExtraDataFromResponse(frame->dataSource()->response()); 3605 GetExtraDataFromResponse(web_url_response);
3605 // Only update the PreviewsState and effective connection type states for new 3606 // Only update the PreviewsState and effective connection type states for new
3606 // main frame documents. Subframes inherit from the main frame and should not 3607 // main frame documents. Subframes inherit from the main frame and should not
3607 // change at commit time. 3608 // change at commit time.
3608 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { 3609 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
3609 previews_state_ = 3610 previews_state_ =
3610 extra_data ? extra_data->previews_state() : PREVIEWS_OFF; 3611 extra_data ? extra_data->previews_state() : PREVIEWS_OFF;
3612
3613 // Set lite pages off if a lite page was not loaded for the main frame.
3614 if (web_url_response
3615 .httpHeaderField(
3616 WebString::fromUTF8("chrome-proxy-content-transform"))
nasko 2017/02/16 18:10:02 Please define a string constant with a symbolic na
megjablon 2017/02/17 20:17:52 Done.
3617 .utf8() != "lite-page") {
3618 previews_state_ &= ~(SERVER_LITE_PAGE_ON);
3619 }
3620
3611 if (extra_data) { 3621 if (extra_data) {
3612 effective_connection_type_ = 3622 effective_connection_type_ =
3613 EffectiveConnectionTypeToWebEffectiveConnectionType( 3623 EffectiveConnectionTypeToWebEffectiveConnectionType(
3614 extra_data->effective_connection_type()); 3624 extra_data->effective_connection_type());
3615 } 3625 }
3616 } 3626 }
3617 3627
3618 if (proxy_routing_id_ != MSG_ROUTING_NONE) { 3628 if (proxy_routing_id_ != MSG_ROUTING_NONE) {
3619 // If this is a provisional frame associated with a proxy (i.e., a frame 3629 // If this is a provisional frame associated with a proxy (i.e., a frame
3620 // created for a remote-to-local navigation), swap it into the frame tree 3630 // created for a remote-to-local navigation), swap it into the frame tree
(...skipping 3193 matching lines...) Expand 10 before | Expand all | Expand 10 after
6814 // event target. Potentially a Pepper plugin will receive the event. 6824 // event target. Potentially a Pepper plugin will receive the event.
6815 // In order to tell whether a plugin gets the last mouse event and which it 6825 // In order to tell whether a plugin gets the last mouse event and which it
6816 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6826 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6817 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6827 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6818 // |pepper_last_mouse_event_target_|. 6828 // |pepper_last_mouse_event_target_|.
6819 pepper_last_mouse_event_target_ = nullptr; 6829 pepper_last_mouse_event_target_ = nullptr;
6820 #endif 6830 #endif
6821 } 6831 }
6822 6832
6823 } // namespace content 6833 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698