OLD | NEW |
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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 | 1232 |
1233 // The initiator should normally be present, unless this is a navigation in a | 1233 // The initiator should normally be present, unless this is a navigation in a |
1234 // top-level frame. It may be null for some top-level navigations (eg: | 1234 // top-level frame. It may be null for some top-level navigations (eg: |
1235 // browser-initiated ones). | 1235 // browser-initiated ones). |
1236 DCHECK(request_data.request_initiator.has_value() || | 1236 DCHECK(request_data.request_initiator.has_value() || |
1237 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME); | 1237 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME); |
1238 new_request->set_initiator(request_data.request_initiator); | 1238 new_request->set_initiator(request_data.request_initiator); |
1239 | 1239 |
1240 if (request_data.originated_from_service_worker) { | 1240 if (request_data.originated_from_service_worker) { |
1241 new_request->SetUserData(URLRequestServiceWorkerData::kUserDataKey, | 1241 new_request->SetUserData(URLRequestServiceWorkerData::kUserDataKey, |
1242 new URLRequestServiceWorkerData()); | 1242 base::MakeUnique<URLRequestServiceWorkerData>()); |
1243 } | 1243 } |
1244 | 1244 |
1245 // If the request is a MAIN_FRAME request, the first-party URL gets updated on | 1245 // If the request is a MAIN_FRAME request, the first-party URL gets updated on |
1246 // redirects. | 1246 // redirects. |
1247 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { | 1247 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { |
1248 new_request->set_first_party_url_policy( | 1248 new_request->set_first_party_url_policy( |
1249 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); | 1249 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); |
1250 } | 1250 } |
1251 | 1251 |
1252 // For PlzNavigate, this request has already been made and the referrer was | 1252 // For PlzNavigate, this request has already been made and the referrer was |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2615 &throttles); | 2615 &throttles); |
2616 if (!throttles.empty()) { | 2616 if (!throttles.empty()) { |
2617 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2617 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
2618 std::move(throttles))); | 2618 std::move(throttles))); |
2619 } | 2619 } |
2620 } | 2620 } |
2621 return handler; | 2621 return handler; |
2622 } | 2622 } |
2623 | 2623 |
2624 } // namespace content | 2624 } // namespace content |
OLD | NEW |