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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 2808663003: Explicitly tell the preload request where to take the referrer from (Closed)
Patch Set: comment Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (type == WTF::kNullopt) 240 if (type == WTF::kNullopt)
241 type = ResourceType(); 241 type = ResourceType();
242 242
243 // The element's 'referrerpolicy' attribute (if present) takes precedence 243 // The element's 'referrerpolicy' attribute (if present) takes precedence
244 // over the document's referrer policy. 244 // over the document's referrer policy.
245 ReferrerPolicy referrer_policy = 245 ReferrerPolicy referrer_policy =
246 (referrer_policy_ != kReferrerPolicyDefault) ? referrer_policy_ 246 (referrer_policy_ != kReferrerPolicyDefault) ? referrer_policy_
247 : document_referrer_policy; 247 : document_referrer_policy;
248 auto request = PreloadRequest::CreateIfNeeded( 248 auto request = PreloadRequest::CreateIfNeeded(
249 InitiatorFor(tag_impl_), position, url_to_load_, predicted_base_url, 249 InitiatorFor(tag_impl_), position, url_to_load_, predicted_base_url,
250 type.value(), referrer_policy, resource_width, client_hints_preferences, 250 type.value(), referrer_policy, PreloadRequest::kDocumentIsReferrer,
251 request_type); 251 resource_width, client_hints_preferences, request_type);
252 if (!request) 252 if (!request)
253 return nullptr; 253 return nullptr;
254 254
255 request->SetCrossOrigin(cross_origin_); 255 request->SetCrossOrigin(cross_origin_);
256 request->SetNonce(nonce_); 256 request->SetNonce(nonce_);
257 request->SetCharset(Charset()); 257 request->SetCharset(Charset());
258 request->SetDefer(defer_); 258 request->SetDefer(defer_);
259 request->SetIntegrityMetadata(integrity_metadata_); 259 request->SetIntegrityMetadata(integrity_metadata_);
260 260
261 return request; 261 return request;
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 default_viewport_min_width = document->ViewportDefaultMinWidth(); 933 default_viewport_min_width = document->ViewportDefaultMinWidth();
934 viewport_meta_zero_values_quirk = 934 viewport_meta_zero_values_quirk =
935 document->GetSettings() && 935 document->GetSettings() &&
936 document->GetSettings()->GetViewportMetaZeroValuesQuirk(); 936 document->GetSettings()->GetViewportMetaZeroValuesQuirk();
937 viewport_meta_enabled = document->GetSettings() && 937 viewport_meta_enabled = document->GetSettings() &&
938 document->GetSettings()->GetViewportMetaEnabled(); 938 document->GetSettings()->GetViewportMetaEnabled();
939 referrer_policy = document->GetReferrerPolicy(); 939 referrer_policy = document->GetReferrerPolicy();
940 } 940 }
941 941
942 } // namespace blink 942 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698