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

Unified Diff: Source/core/loader/LinkLoader.cpp

Issue 135723008: Add CORS support for <link> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
« Source/core/html/HTMLLinkElement.cpp ('K') | « Source/core/loader/LinkLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/LinkLoader.cpp
diff --git a/Source/core/loader/LinkLoader.cpp b/Source/core/loader/LinkLoader.cpp
index 25c23488f04ba758900e36b47a0f75d52ef52502..afdadb7fc2ec7a2212184e5733cc8b85ace461e5 100644
--- a/Source/core/loader/LinkLoader.cpp
+++ b/Source/core/loader/LinkLoader.cpp
@@ -98,7 +98,7 @@ void LinkLoader::didSendDOMContentLoadedForPrerender()
m_client->didSendDOMContentLoadedForLinkPrerender();
}
-bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& type, const KURL& href, Document& document)
+bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& crossOriginMode, const String& type, const KURL& href, Document& document)
{
if (relAttribute.isDNSPrefetch()) {
Settings* settings = document.settings();
@@ -114,6 +114,10 @@ bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const String& ty
return false;
Resource::Type type = relAttribute.isLinkSubresource() ? Resource::LinkSubresource : Resource::LinkPrefetch;
FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), FetchInitiatorTypeNames::link);
+ if (!crossOriginMode.isNull()) {
+ StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
abarth-chromium 2014/01/28 06:38:45 It's even twice in this CL. :)
+ linkRequest.setCrossOriginAccessControl(document.securityOrigin(), allowCredentials);
+ }
setResource(document.fetcher()->fetchLinkResource(type, linkRequest));
}
« Source/core/html/HTMLLinkElement.cpp ('K') | « Source/core/loader/LinkLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698