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

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

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 5 years, 3 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 (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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 return; 1224 return;
1225 } 1225 }
1226 1226
1227 // Construct the request. 1227 // Construct the request.
1228 scoped_ptr<net::URLRequest> new_request = request_context->CreateRequest( 1228 scoped_ptr<net::URLRequest> new_request = request_context->CreateRequest(
1229 request_data.url, request_data.priority, NULL); 1229 request_data.url, request_data.priority, NULL);
1230 1230
1231 new_request->set_method(request_data.method); 1231 new_request->set_method(request_data.method);
1232 new_request->set_first_party_for_cookies( 1232 new_request->set_first_party_for_cookies(
1233 request_data.first_party_for_cookies); 1233 request_data.first_party_for_cookies);
1234 if (request_data.lofi_state <= 2 && request_data.lofi_state >= 0) {
nasko 2015/09/04 22:47:42 Please, let's use named constants, not verbatim nu
megjablon 2015/09/09 20:54:16 Done.
1235 new_request->set_lofi_state(
1236 static_cast<net::LoFiState>(request_data.lofi_state));
1237 }
1234 1238
1235 // If the request is a MAIN_FRAME request, the first-party URL gets updated on 1239 // If the request is a MAIN_FRAME request, the first-party URL gets updated on
1236 // redirects. 1240 // redirects.
1237 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { 1241 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) {
1238 new_request->set_first_party_url_policy( 1242 new_request->set_first_party_url_policy(
1239 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 1243 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
1240 } 1244 }
1241 1245
1242 const Referrer referrer(request_data.referrer, request_data.referrer_policy); 1246 const Referrer referrer(request_data.referrer, request_data.referrer_policy);
1243 SetReferrerForRequest(new_request.get(), referrer); 1247 SetReferrerForRequest(new_request.get(), referrer);
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 load_flags |= net::LOAD_PREFETCH; 2410 load_flags |= net::LOAD_PREFETCH;
2407 } 2411 }
2408 2412
2409 if (is_sync_load) 2413 if (is_sync_load)
2410 load_flags |= net::LOAD_IGNORE_LIMITS; 2414 load_flags |= net::LOAD_IGNORE_LIMITS;
2411 2415
2412 return load_flags; 2416 return load_flags;
2413 } 2417 }
2414 2418
2415 } // namespace content 2419 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698