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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 1dbb604cf43a662629a8c84f71bcc1d9d427534e..2d41712a45527ab77aed94835787d59810dec28f 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -44,6 +44,7 @@
#include "core/frame/SubresourceIntegrity.h"
#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
+#include "core/html/CrossOriginAttribute.h"
#include "core/html/LinkManifest.h"
#include "core/html/imports/LinkImport.h"
#include "core/inspector/ConsoleMessage.h"
@@ -202,7 +203,7 @@ bool HTMLLinkElement::shouldLoadLink()
bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url)
{
- return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::crossoriginAttr), type, as, url, document(), NetworkHintsInterfaceImpl());
+ return m_linkLoader.loadLink(m_relAttribute, crossOriginAttributeValue(fastGetAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHintsInterfaceImpl());
}
LinkResource* HTMLLinkElement::linkResourceToProcess()
@@ -724,9 +725,9 @@ void LinkStyle::process()
// Load stylesheets that are not needed for the layout immediately with low priority.
FetchRequest request = builder.build(blocking);
- AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::crossoriginAttr);
- if (!crossOriginMode.isNull()) {
- request.setCrossOriginAccessControl(document().securityOrigin(), crossOriginMode);
+ CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owner->fastGetAttribute(HTMLNames::crossoriginAttr));
+ if (crossOrigin != CrossOriginAttributeNotSet) {
+ request.setCrossOriginAccessControl(document().securityOrigin(), crossOrigin);
setFetchFollowingCORS();
}
setResource(CSSStyleSheetResource::fetch(request, document().fetcher()));
« 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