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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2010 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 void CSSPreloadScanner::EmitRule(const SegmentedString& source) { 236 void CSSPreloadScanner::EmitRule(const SegmentedString& source) {
237 if (EqualIgnoringCase(rule_, "import")) { 237 if (EqualIgnoringCase(rule_, "import")) {
238 String url = ParseCSSStringOrURL(rule_value_.ToString()); 238 String url = ParseCSSStringOrURL(rule_value_.ToString());
239 TextPosition position = 239 TextPosition position =
240 TextPosition(source.CurrentLine(), source.CurrentColumn()); 240 TextPosition(source.CurrentLine(), source.CurrentColumn());
241 auto request = PreloadRequest::CreateIfNeeded( 241 auto request = PreloadRequest::CreateIfNeeded(
242 FetchInitiatorTypeNames::css, position, url, 242 FetchInitiatorTypeNames::css, position, url,
243 *predicted_base_element_url_, Resource::kCSSStyleSheet, 243 *predicted_base_element_url_, Resource::kCSSStyleSheet,
244 referrer_policy_); 244 referrer_policy_, PreloadRequest::kBaseUrlIsReferrer);
245 if (request) { 245 if (request) {
246 // FIXME: Should this be including the charset in the preload request? 246 // FIXME: Should this be including the charset in the preload request?
247 requests_->push_back(std::move(request)); 247 requests_->push_back(std::move(request));
248 } 248 }
249 state_ = kInitial; 249 state_ = kInitial;
250 } else if (EqualIgnoringCase(rule_, "charset")) 250 } else if (EqualIgnoringCase(rule_, "charset"))
251 state_ = kInitial; 251 state_ = kInitial;
252 else 252 else
253 state_ = kDoneParsingImportRules; 253 state_ = kDoneParsingImportRules;
254 rule_.Clear(); 254 rule_.Clear();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 resource_.Clear(); 362 resource_.Clear();
363 } 363 }
364 364
365 DEFINE_TRACE(CSSPreloaderResourceClient) { 365 DEFINE_TRACE(CSSPreloaderResourceClient) {
366 visitor->Trace(preloader_); 366 visitor->Trace(preloader_);
367 visitor->Trace(resource_); 367 visitor->Trace(resource_);
368 StyleSheetResourceClient::Trace(visitor); 368 StyleSheetResourceClient::Trace(visitor);
369 } 369 }
370 370
371 } // namespace blink 371 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698