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

Side by Side Diff: third_party/WebKit/Source/core/loader/ImageLoader.cpp

Issue 1801513003: Cross origin requests to same origin should match Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing CORS tests Created 4 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (LayoutImageResource* imageResource = layoutImageResource()) 234 if (LayoutImageResource* imageResource = layoutImageResource())
235 imageResource->resetAnimation(); 235 imageResource->resetAnimation();
236 } 236 }
237 237
238 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld Behavior bypassBehavior, Element& element, const ClientHintsPreferences& clientH intsPreferences) 238 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld Behavior bypassBehavior, Element& element, const ClientHintsPreferences& clientH intsPreferences)
239 { 239 {
240 if (bypassBehavior == ImageLoader::BypassMainWorldCSP) 240 if (bypassBehavior == ImageLoader::BypassMainWorldCSP)
241 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); 241 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
242 242
243 CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(element.fa stGetAttribute(HTMLNames::crossoriginAttr)); 243 CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(element.fa stGetAttribute(HTMLNames::crossoriginAttr));
244 if (crossOrigin != CrossOriginAttributeNotSet) 244 request.setCrossOriginAccessControl(element.document().getSecurityOrigin(), crossOrigin);
245 request.setCrossOriginAccessControl(element.document().getSecurityOrigin (), crossOrigin);
246 245
247 if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(e lement)) 246 if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(e lement))
248 request.setResourceWidth(toHTMLImageElement(element).getResourceWidth()) ; 247 request.setResourceWidth(toHTMLImageElement(element).getResourceWidth()) ;
249 } 248 }
250 249
251 inline void ImageLoader::dispatchErrorEvent() 250 inline void ImageLoader::dispatchErrorEvent()
252 { 251 {
253 m_hasPendingErrorEvent = true; 252 m_hasPendingErrorEvent = true;
254 errorEventSender().dispatchEventSoon(this); 253 errorEventSender().dispatchEventSoon(this);
255 } 254 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 625
627 void ImageLoader::elementDidMoveToNewDocument() 626 void ImageLoader::elementDidMoveToNewDocument()
628 { 627 {
629 if (m_loadDelayCounter) 628 if (m_loadDelayCounter)
630 m_loadDelayCounter->documentChanged(m_element->document()); 629 m_loadDelayCounter->documentChanged(m_element->document());
631 clearFailedLoadURL(); 630 clearFailedLoadURL();
632 setImage(0); 631 setImage(0);
633 } 632 }
634 633
635 } // namespace blink 634 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698