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

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

Issue 1003953008: Remove prerender cookie store, part 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-revert-cookie-store-3
Patch Set: rebase (just in case since this is so huge) Created 5 years, 9 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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 request_data.url, 1148 request_data.url,
1149 request_data.resource_type, 1149 request_data.resource_type,
1150 resource_context)) { 1150 resource_context)) {
1151 AbortRequestBeforeItStarts(filter_, sync_result, request_id); 1151 AbortRequestBeforeItStarts(filter_, sync_result, request_id);
1152 return; 1152 return;
1153 } 1153 }
1154 1154
1155 // Construct the request. 1155 // Construct the request.
1156 scoped_ptr<net::URLRequest> new_request; 1156 scoped_ptr<net::URLRequest> new_request;
1157 new_request = request_context->CreateRequest( 1157 new_request = request_context->CreateRequest(
1158 request_data.url, request_data.priority, NULL, NULL); 1158 request_data.url, request_data.priority, NULL);
1159 1159
1160 new_request->set_method(request_data.method); 1160 new_request->set_method(request_data.method);
1161 new_request->set_first_party_for_cookies( 1161 new_request->set_first_party_for_cookies(
1162 request_data.first_party_for_cookies); 1162 request_data.first_party_for_cookies);
1163 1163
1164 // If the request is a MAIN_FRAME request, the first-party URL gets updated on 1164 // If the request is a MAIN_FRAME request, the first-party URL gets updated on
1165 // redirects. 1165 // redirects.
1166 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { 1166 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) {
1167 new_request->set_first_party_url_policy( 1167 new_request->set_first_party_url_policy(
1168 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 1168 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 request_context->job_factory()->IsHandledURL(url); 1585 request_context->job_factory()->IsHandledURL(url);
1586 if (!known_proto) { 1586 if (!known_proto) {
1587 // Since any URLs which have non-standard scheme have been filtered 1587 // Since any URLs which have non-standard scheme have been filtered
1588 // by save manager(see GURL::SchemeIsStandard). This situation 1588 // by save manager(see GURL::SchemeIsStandard). This situation
1589 // should not happen. 1589 // should not happen.
1590 NOTREACHED(); 1590 NOTREACHED();
1591 return; 1591 return;
1592 } 1592 }
1593 1593
1594 scoped_ptr<net::URLRequest> request( 1594 scoped_ptr<net::URLRequest> request(
1595 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, NULL, NULL)); 1595 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, NULL));
1596 request->set_method("GET"); 1596 request->set_method("GET");
1597 SetReferrerForRequest(request.get(), referrer); 1597 SetReferrerForRequest(request.get(), referrer);
1598 1598
1599 // So far, for saving page, we need fetch content from cache, in the 1599 // So far, for saving page, we need fetch content from cache, in the
1600 // future, maybe we can use a configuration to configure this behavior. 1600 // future, maybe we can use a configuration to configure this behavior.
1601 request->SetLoadFlags(net::LOAD_PREFERRING_CACHE); 1601 request->SetLoadFlags(net::LOAD_PREFERRING_CACHE);
1602 1602
1603 // Since we're just saving some resources we need, disallow downloading. 1603 // Since we're just saving some resources we need, disallow downloading.
1604 ResourceRequestInfoImpl* extra_info = 1604 ResourceRequestInfoImpl* extra_info =
1605 CreateRequestInfo(child_id, route_id, false, context); 1605 CreateRequestInfo(child_id, route_id, false, context);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 1890
1891 // TODO(davidben): BuildLoadFlagsForRequest includes logic for 1891 // TODO(davidben): BuildLoadFlagsForRequest includes logic for
1892 // CanSendCookiesForOrigin and CanReadRawCookies. Is this needed here? 1892 // CanSendCookiesForOrigin and CanReadRawCookies. Is this needed here?
1893 1893
1894 // Sync loads should have maximum priority and should be the only 1894 // Sync loads should have maximum priority and should be the only
1895 // requests that have the ignore limits flag set. 1895 // requests that have the ignore limits flag set.
1896 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); 1896 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS));
1897 1897
1898 scoped_ptr<net::URLRequest> new_request; 1898 scoped_ptr<net::URLRequest> new_request;
1899 new_request = request_context->CreateRequest( 1899 new_request = request_context->CreateRequest(
1900 info.common_params.url, net::HIGHEST, nullptr, nullptr); 1900 info.common_params.url, net::HIGHEST, nullptr);
1901 1901
1902 new_request->set_method(info.begin_params.method); 1902 new_request->set_method(info.begin_params.method);
1903 new_request->set_first_party_for_cookies( 1903 new_request->set_first_party_for_cookies(
1904 info.first_party_for_cookies); 1904 info.first_party_for_cookies);
1905 if (info.is_main_frame) { 1905 if (info.is_main_frame) {
1906 new_request->set_first_party_url_policy( 1906 new_request->set_first_party_url_policy(
1907 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 1907 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
1908 } 1908 }
1909 1909
1910 SetReferrerForRequest(new_request.get(), info.common_params.referrer); 1910 SetReferrerForRequest(new_request.get(), info.common_params.referrer);
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 2346
2347 // Add a flag to selectively bypass the data reduction proxy if the resource 2347 // Add a flag to selectively bypass the data reduction proxy if the resource
2348 // type is not an image. 2348 // type is not an image.
2349 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) 2349 if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
2350 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 2350 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2351 2351
2352 return load_flags; 2352 return load_flags;
2353 } 2353 }
2354 2354
2355 } // namespace content 2355 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698