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

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

Issue 2099243002: PlzNavigate: properly set the initiator of the navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 3 years, 12 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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 // requests that have the ignore limits flag set. 2172 // requests that have the ignore limits flag set.
2173 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); 2173 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS));
2174 2174
2175 std::unique_ptr<net::URLRequest> new_request; 2175 std::unique_ptr<net::URLRequest> new_request;
2176 new_request = request_context->CreateRequest( 2176 new_request = request_context->CreateRequest(
2177 info.common_params.url, net::HIGHEST, nullptr); 2177 info.common_params.url, net::HIGHEST, nullptr);
2178 2178
2179 new_request->set_method(info.common_params.method); 2179 new_request->set_method(info.common_params.method);
2180 new_request->set_first_party_for_cookies( 2180 new_request->set_first_party_for_cookies(
2181 info.first_party_for_cookies); 2181 info.first_party_for_cookies);
2182 new_request->set_initiator(info.request_initiator); 2182 new_request->set_initiator(info.begin_params.initiator_origin);
2183 if (info.is_main_frame) { 2183 if (info.is_main_frame) {
2184 new_request->set_first_party_url_policy( 2184 new_request->set_first_party_url_policy(
2185 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 2185 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
2186 } 2186 }
2187 2187
2188 SetReferrerForRequest(new_request.get(), info.common_params.referrer); 2188 SetReferrerForRequest(new_request.get(), info.common_params.referrer);
2189 2189
2190 net::HttpRequestHeaders headers; 2190 net::HttpRequestHeaders headers;
2191 headers.AddHeadersFromString(info.begin_params.headers); 2191 headers.AddHeadersFromString(info.begin_params.headers);
2192 new_request->SetExtraRequestHeaders(headers); 2192 new_request->SetExtraRequestHeaders(headers);
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 &throttles); 2823 &throttles);
2824 if (!throttles.empty()) { 2824 if (!throttles.empty()) {
2825 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2825 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2826 std::move(throttles))); 2826 std::move(throttles)));
2827 } 2827 }
2828 } 2828 }
2829 return handler; 2829 return handler;
2830 } 2830 }
2831 2831
2832 } // namespace content 2832 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698