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

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

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Introduce NullableOrigin to use for request initiator Created 4 years, 2 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 <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 // requests that have the ignore limits flag set. 2112 // requests that have the ignore limits flag set.
2113 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); 2113 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS));
2114 2114
2115 std::unique_ptr<net::URLRequest> new_request; 2115 std::unique_ptr<net::URLRequest> new_request;
2116 new_request = request_context->CreateRequest( 2116 new_request = request_context->CreateRequest(
2117 info.common_params.url, net::HIGHEST, nullptr); 2117 info.common_params.url, net::HIGHEST, nullptr);
2118 2118
2119 new_request->set_method(info.common_params.method); 2119 new_request->set_method(info.common_params.method);
2120 new_request->set_first_party_for_cookies( 2120 new_request->set_first_party_for_cookies(
2121 info.first_party_for_cookies); 2121 info.first_party_for_cookies);
2122 new_request->set_initiator(info.request_initiator); 2122 new_request->set_initiator(new url::NullableOrigin(info.request_initiator));
2123 if (info.is_main_frame) { 2123 if (info.is_main_frame) {
2124 new_request->set_first_party_url_policy( 2124 new_request->set_first_party_url_policy(
2125 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 2125 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
2126 } 2126 }
2127 2127
2128 SetReferrerForRequest(new_request.get(), info.common_params.referrer); 2128 SetReferrerForRequest(new_request.get(), info.common_params.referrer);
2129 2129
2130 net::HttpRequestHeaders headers; 2130 net::HttpRequestHeaders headers;
2131 headers.AddHeadersFromString(info.begin_params.headers); 2131 headers.AddHeadersFromString(info.begin_params.headers);
2132 new_request->SetExtraRequestHeaders(headers); 2132 new_request->SetExtraRequestHeaders(headers);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 &throttles); 2735 &throttles);
2736 if (!throttles.empty()) { 2736 if (!throttles.empty()) {
2737 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2737 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2738 std::move(throttles))); 2738 std::move(throttles)));
2739 } 2739 }
2740 } 2740 }
2741 return handler; 2741 return handler;
2742 } 2742 }
2743 2743
2744 } // namespace content 2744 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698