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

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: Fixed issue in SW preload Created 4 years 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 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 // requests that have the ignore limits flag set. 2175 // requests that have the ignore limits flag set.
2176 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); 2176 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS));
2177 2177
2178 std::unique_ptr<net::URLRequest> new_request; 2178 std::unique_ptr<net::URLRequest> new_request;
2179 new_request = request_context->CreateRequest( 2179 new_request = request_context->CreateRequest(
2180 info.common_params.url, net::HIGHEST, nullptr); 2180 info.common_params.url, net::HIGHEST, nullptr);
2181 2181
2182 new_request->set_method(info.common_params.method); 2182 new_request->set_method(info.common_params.method);
2183 new_request->set_first_party_for_cookies( 2183 new_request->set_first_party_for_cookies(
2184 info.first_party_for_cookies); 2184 info.first_party_for_cookies);
2185 new_request->set_initiator(info.request_initiator); 2185 new_request->set_initiator(info.begin_params.initiator);
2186 if (info.is_main_frame) { 2186 if (info.is_main_frame) {
2187 new_request->set_first_party_url_policy( 2187 new_request->set_first_party_url_policy(
2188 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 2188 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
2189 } 2189 }
2190 2190
2191 SetReferrerForRequest(new_request.get(), info.common_params.referrer); 2191 SetReferrerForRequest(new_request.get(), info.common_params.referrer);
2192 2192
2193 net::HttpRequestHeaders headers; 2193 net::HttpRequestHeaders headers;
2194 headers.AddHeadersFromString(info.begin_params.headers); 2194 headers.AddHeadersFromString(info.begin_params.headers);
2195 new_request->SetExtraRequestHeaders(headers); 2195 new_request->SetExtraRequestHeaders(headers);
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 &throttles); 2831 &throttles);
2832 if (!throttles.empty()) { 2832 if (!throttles.empty()) {
2833 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2833 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2834 std::move(throttles))); 2834 std::move(throttles)));
2835 } 2835 }
2836 } 2836 }
2837 return handler; 2837 return handler;
2838 } 2838 }
2839 2839
2840 } // namespace content 2840 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698