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

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

Issue 1487343002: Set credentials mode "same-origin" when crossOrigin=anonymous is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 26 matching lines...) Expand all
37 #include "core/events/Event.h" 37 #include "core/events/Event.h"
38 #include "core/events/EventSender.h" 38 #include "core/events/EventSender.h"
39 #include "core/fetch/CSSStyleSheetResource.h" 39 #include "core/fetch/CSSStyleSheetResource.h"
40 #include "core/fetch/FetchRequest.h" 40 #include "core/fetch/FetchRequest.h"
41 #include "core/fetch/ResourceFetcher.h" 41 #include "core/fetch/ResourceFetcher.h"
42 #include "core/frame/FrameView.h" 42 #include "core/frame/FrameView.h"
43 #include "core/frame/LocalFrame.h" 43 #include "core/frame/LocalFrame.h"
44 #include "core/frame/SubresourceIntegrity.h" 44 #include "core/frame/SubresourceIntegrity.h"
45 #include "core/frame/UseCounter.h" 45 #include "core/frame/UseCounter.h"
46 #include "core/frame/csp/ContentSecurityPolicy.h" 46 #include "core/frame/csp/ContentSecurityPolicy.h"
47 #include "core/html/CrossOriginAttribute.h"
47 #include "core/html/LinkManifest.h" 48 #include "core/html/LinkManifest.h"
48 #include "core/html/imports/LinkImport.h" 49 #include "core/html/imports/LinkImport.h"
49 #include "core/inspector/ConsoleMessage.h" 50 #include "core/inspector/ConsoleMessage.h"
50 #include "core/loader/FrameLoader.h" 51 #include "core/loader/FrameLoader.h"
51 #include "core/loader/FrameLoaderClient.h" 52 #include "core/loader/FrameLoaderClient.h"
52 #include "core/loader/NetworkHintsInterface.h" 53 #include "core/loader/NetworkHintsInterface.h"
53 #include "core/style/StyleInheritedData.h" 54 #include "core/style/StyleInheritedData.h"
54 #include "platform/RuntimeEnabledFeatures.h" 55 #include "platform/RuntimeEnabledFeatures.h"
55 #include "wtf/StdLibExtras.h" 56 #include "wtf/StdLibExtras.h"
56 57
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 196 }
196 } 197 }
197 198
198 bool HTMLLinkElement::shouldLoadLink() 199 bool HTMLLinkElement::shouldLoadLink()
199 { 200 {
200 return inDocument(); 201 return inDocument();
201 } 202 }
202 203
203 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url) 204 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url)
204 { 205 {
205 return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::cro ssoriginAttr), type, as, url, document(), NetworkHintsInterfaceImpl()); 206 return m_linkLoader.loadLink(m_relAttribute, crossOriginAttributeValue(fastG etAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHint sInterfaceImpl());
206 } 207 }
207 208
208 LinkResource* HTMLLinkElement::linkResourceToProcess() 209 LinkResource* HTMLLinkElement::linkResourceToProcess()
209 { 210 {
210 bool visible = inDocument() && !m_isInShadowTree; 211 bool visible = inDocument() && !m_isInShadowTree;
211 if (!visible) { 212 if (!visible) {
212 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); 213 ASSERT(!linkStyle() || !linkStyle()->hasSheet());
213 return nullptr; 214 return nullptr;
214 } 215 }
215 216
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 mediaQueryMatches = evaluator.eval(media.get()); 718 mediaQueryMatches = evaluator.eval(media.get());
718 } 719 }
719 720
720 // Don't hold up layout tree construction and script execution on styles heets 721 // Don't hold up layout tree construction and script execution on styles heets
721 // that are not needed for the layout at the moment. 722 // that are not needed for the layout at the moment.
722 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); 723 bool blocking = mediaQueryMatches && !m_owner->isAlternate();
723 addPendingSheet(blocking ? Blocking : NonBlocking); 724 addPendingSheet(blocking ? Blocking : NonBlocking);
724 725
725 // Load stylesheets that are not needed for the layout immediately with low priority. 726 // Load stylesheets that are not needed for the layout immediately with low priority.
726 FetchRequest request = builder.build(blocking); 727 FetchRequest request = builder.build(blocking);
727 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros soriginAttr); 728 CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owne r->fastGetAttribute(HTMLNames::crossoriginAttr));
728 if (!crossOriginMode.isNull()) { 729 if (crossOrigin != CrossOriginAttributeNotSet) {
729 request.setCrossOriginAccessControl(document().securityOrigin(), cro ssOriginMode); 730 request.setCrossOriginAccessControl(document().securityOrigin(), cro ssOrigin);
730 setFetchFollowingCORS(); 731 setFetchFollowingCORS();
731 } 732 }
732 setResource(CSSStyleSheetResource::fetch(request, document().fetcher())) ; 733 setResource(CSSStyleSheetResource::fetch(request, document().fetcher())) ;
733 734
734 if (!resource()) { 735 if (!resource()) {
735 // The request may have been denied if (for example) the stylesheet is local and the document is remote, or if there was a Content Security Policy F ailure. 736 // The request may have been denied if (for example) the stylesheet is local and the document is remote, or if there was a Content Security Policy F ailure.
736 m_loading = false; 737 m_loading = false;
737 removePendingSheet(); 738 removePendingSheet();
738 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadi ngSubresource); 739 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadi ngSubresource);
739 } 740 }
(...skipping 20 matching lines...) Expand all
760 removePendingSheet(); 761 removePendingSheet();
761 } 762 }
762 763
763 DEFINE_TRACE(LinkStyle) 764 DEFINE_TRACE(LinkStyle)
764 { 765 {
765 visitor->trace(m_sheet); 766 visitor->trace(m_sheet);
766 LinkResource::trace(visitor); 767 LinkResource::trace(visitor);
767 } 768 }
768 769
769 } // namespace blink 770 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchRequest.cpp ('k') | third_party/WebKit/Source/core/html/HTMLTrackElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698