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

Unified Diff: third_party/WebKit/Source/core/loader/ImageLoader.cpp

Issue 2415373002: Loading: bulk style errors fix in core/loader (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/ImageLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
index 649ffdb112c799e2283f1eeeb039b77d5c5d5a62..296a26d1d3ed5e4277e875d80a80ea782b5c9407 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -231,9 +231,10 @@ static void configureRequest(
CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(
element.fastGetAttribute(HTMLNames::crossoriginAttr));
- if (crossOrigin != CrossOriginAttributeNotSet)
+ if (crossOrigin != CrossOriginAttributeNotSet) {
request.setCrossOriginAccessControl(element.document().getSecurityOrigin(),
crossOrigin);
+ }
if (clientHintsPreferences.shouldSendResourceWidth() &&
isHTMLImageElement(element))
@@ -299,9 +300,10 @@ void ImageLoader::doUpdateFromElement(BypassMainWorldBehavior bypassBehavior,
resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
}
- if (referrerPolicy != ReferrerPolicyDefault)
+ if (referrerPolicy != ReferrerPolicyDefault) {
resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(
referrerPolicy, url, document.outgoingReferrer()));
+ }
if (isHTMLPictureElement(element()->parentNode()) ||
!element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull())
@@ -486,9 +488,10 @@ void ImageLoader::imageNotifyFinished(ImageResource* resource) {
loadEventSender().cancelEvent(this);
m_hasPendingLoadEvent = false;
- if (resource->resourceError().isAccessCheck())
+ if (resource->resourceError().isAccessCheck()) {
crossSiteOrCSPViolationOccurred(
AtomicString(resource->resourceError().failingURL()));
+ }
// The error event should not fire if the image data update is a result of
// environment change.
« no previous file with comments | « third_party/WebKit/Source/core/loader/HttpEquiv.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698