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

Side by Side Diff: content/browser/loader/resource_request_info_impl.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr comments and rebase Created 5 years, 1 month 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
« no previous file with comments | « content/browser/loader/resource_request_info_impl.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/loader/resource_request_info_impl.h" 5 #include "content/browser/loader/resource_request_info_impl.h"
6 6
7 #include "content/browser/loader/global_routing_id.h" 7 #include "content/browser/loader/global_routing_id.h"
8 #include "content/browser/loader/resource_message_filter.h" 8 #include "content/browser/loader/resource_message_filter.h"
9 #include "content/common/net/url_request_user_data.h" 9 #include "content/common/net/url_request_user_data.h"
10 #include "content/public/browser/global_request_id.h" 10 #include "content/public/browser/global_request_id.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 allow_download, // allow_download 61 allow_download, // allow_download
62 false, // has_user_gesture 62 false, // has_user_gesture
63 false, // enable load timing 63 false, // enable load timing
64 request->has_upload(), // enable upload progress 64 request->has_upload(), // enable upload progress
65 false, // do_not_prompt_for_login 65 false, // do_not_prompt_for_login
66 blink::WebReferrerPolicyDefault, // referrer_policy 66 blink::WebReferrerPolicyDefault, // referrer_policy
67 blink::WebPageVisibilityStateVisible, // visibility_state 67 blink::WebPageVisibilityStateVisible, // visibility_state
68 context, // context 68 context, // context
69 base::WeakPtr<ResourceMessageFilter>(), // filter 69 base::WeakPtr<ResourceMessageFilter>(), // filter
70 false, // report_raw_headers 70 false, // report_raw_headers
71 is_async); // is_async 71 is_async, // is_async
72 false); // is_using_lofi
72 info->AssociateWithRequest(request); 73 info->AssociateWithRequest(request);
73 } 74 }
74 75
75 // static 76 // static
76 bool ResourceRequestInfo::GetRenderFrameForRequest( 77 bool ResourceRequestInfo::GetRenderFrameForRequest(
77 const net::URLRequest* request, 78 const net::URLRequest* request,
78 int* render_process_id, 79 int* render_process_id,
79 int* render_frame_id) { 80 int* render_frame_id) {
80 URLRequestUserData* user_data = static_cast<URLRequestUserData*>( 81 URLRequestUserData* user_data = static_cast<URLRequestUserData*>(
81 request->GetUserData(URLRequestUserData::kUserDataKey)); 82 request->GetUserData(URLRequestUserData::kUserDataKey));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 bool allow_download, 121 bool allow_download,
121 bool has_user_gesture, 122 bool has_user_gesture,
122 bool enable_load_timing, 123 bool enable_load_timing,
123 bool enable_upload_progress, 124 bool enable_upload_progress,
124 bool do_not_prompt_for_login, 125 bool do_not_prompt_for_login,
125 blink::WebReferrerPolicy referrer_policy, 126 blink::WebReferrerPolicy referrer_policy,
126 blink::WebPageVisibilityState visibility_state, 127 blink::WebPageVisibilityState visibility_state,
127 ResourceContext* context, 128 ResourceContext* context,
128 base::WeakPtr<ResourceMessageFilter> filter, 129 base::WeakPtr<ResourceMessageFilter> filter,
129 bool report_raw_headers, 130 bool report_raw_headers,
130 bool is_async) 131 bool is_async,
132 bool is_using_lofi)
131 : cross_site_handler_(NULL), 133 : cross_site_handler_(NULL),
132 detachable_handler_(NULL), 134 detachable_handler_(NULL),
133 process_type_(process_type), 135 process_type_(process_type),
134 child_id_(child_id), 136 child_id_(child_id),
135 route_id_(route_id), 137 route_id_(route_id),
136 frame_tree_node_id_(frame_tree_node_id), 138 frame_tree_node_id_(frame_tree_node_id),
137 origin_pid_(origin_pid), 139 origin_pid_(origin_pid),
138 request_id_(request_id), 140 request_id_(request_id),
139 render_frame_id_(render_frame_id), 141 render_frame_id_(render_frame_id),
140 is_main_frame_(is_main_frame), 142 is_main_frame_(is_main_frame),
(...skipping 10 matching lines...) Expand all
151 was_ignored_by_handler_(false), 153 was_ignored_by_handler_(false),
152 counted_as_in_flight_request_(false), 154 counted_as_in_flight_request_(false),
153 resource_type_(resource_type), 155 resource_type_(resource_type),
154 transition_type_(transition_type), 156 transition_type_(transition_type),
155 memory_cost_(0), 157 memory_cost_(0),
156 referrer_policy_(referrer_policy), 158 referrer_policy_(referrer_policy),
157 visibility_state_(visibility_state), 159 visibility_state_(visibility_state),
158 context_(context), 160 context_(context),
159 filter_(filter), 161 filter_(filter),
160 report_raw_headers_(report_raw_headers), 162 report_raw_headers_(report_raw_headers),
161 is_async_(is_async) { 163 is_async_(is_async),
164 is_using_lofi_(is_using_lofi) {
162 } 165 }
163 166
164 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() { 167 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() {
165 } 168 }
166 169
167 ResourceContext* ResourceRequestInfoImpl::GetContext() const { 170 ResourceContext* ResourceRequestInfoImpl::GetContext() const {
168 return context_; 171 return context_;
169 } 172 }
170 173
171 int ResourceRequestInfoImpl::GetChildID() const { 174 int ResourceRequestInfoImpl::GetChildID() const {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 246 }
244 247
245 bool ResourceRequestInfoImpl::IsAsync() const { 248 bool ResourceRequestInfoImpl::IsAsync() const {
246 return is_async_; 249 return is_async_;
247 } 250 }
248 251
249 bool ResourceRequestInfoImpl::IsDownload() const { 252 bool ResourceRequestInfoImpl::IsDownload() const {
250 return is_download_; 253 return is_download_;
251 } 254 }
252 255
256 bool ResourceRequestInfoImpl::IsUsingLoFi() const {
257 return is_using_lofi_;
258 }
259
253 bool ResourceRequestInfoImpl::ShouldReportRawHeaders() const { 260 bool ResourceRequestInfoImpl::ShouldReportRawHeaders() const {
254 return report_raw_headers_; 261 return report_raw_headers_;
255 } 262 }
256 263
257 void ResourceRequestInfoImpl::AssociateWithRequest(net::URLRequest* request) { 264 void ResourceRequestInfoImpl::AssociateWithRequest(net::URLRequest* request) {
258 request->SetUserData(NULL, this); 265 request->SetUserData(NULL, this);
259 int render_process_id; 266 int render_process_id;
260 int render_frame_id; 267 int render_frame_id;
261 if (GetAssociatedRenderFrame(&render_process_id, &render_frame_id)) { 268 if (GetAssociatedRenderFrame(&render_process_id, &render_frame_id)) {
262 request->SetUserData( 269 request->SetUserData(
(...skipping 19 matching lines...) Expand all
282 base::WeakPtr<ResourceMessageFilter> filter) { 289 base::WeakPtr<ResourceMessageFilter> filter) {
283 child_id_ = child_id; 290 child_id_ = child_id;
284 route_id_ = route_id; 291 route_id_ = route_id;
285 origin_pid_ = origin_pid; 292 origin_pid_ = origin_pid;
286 request_id_ = request_id; 293 request_id_ = request_id;
287 parent_render_frame_id_ = parent_render_frame_id; 294 parent_render_frame_id_ = parent_render_frame_id;
288 filter_ = filter; 295 filter_ = filter;
289 } 296 }
290 297
291 } // namespace content 298 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_request_info_impl.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698