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

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

Issue 2855163002: Avoid sending mixed-content requests for ImageSet contexts (Closed)
Patch Set: Better check and a test Created 3 years, 7 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, 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 (DeprecatedEqualIgnoringCase(rule_, "import")) { 237 if (DeprecatedEqualIgnoringCase(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_, PreloadRequest::kBaseUrlIsReferrer); 244 referrer_policy_, PreloadRequest::kBaseUrlIsReferrer,
245 ResourceFetcher::kImageNotImageSet);
245 if (request) { 246 if (request) {
246 // FIXME: Should this be including the charset in the preload request? 247 // FIXME: Should this be including the charset in the preload request?
247 requests_->push_back(std::move(request)); 248 requests_->push_back(std::move(request));
248 } 249 }
249 state_ = kInitial; 250 state_ = kInitial;
250 } else if (DeprecatedEqualIgnoringCase(rule_, "charset")) 251 } else if (DeprecatedEqualIgnoringCase(rule_, "charset"))
251 state_ = kInitial; 252 state_ = kInitial;
252 else 253 else
253 state_ = kDoneParsingImportRules; 254 state_ = kDoneParsingImportRules;
254 rule_.Clear(); 255 rule_.Clear();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 resource_.Clear(); 363 resource_.Clear();
363 } 364 }
364 365
365 DEFINE_TRACE(CSSPreloaderResourceClient) { 366 DEFINE_TRACE(CSSPreloaderResourceClient) {
366 visitor->Trace(preloader_); 367 visitor->Trace(preloader_);
367 visitor->Trace(resource_); 368 visitor->Trace(resource_);
368 StyleSheetResourceClient::Trace(visitor); 369 StyleSheetResourceClient::Trace(visitor);
369 } 370 }
370 371
371 } // namespace blink 372 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698