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

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: Add setCrossOriginAccessControl() helper to avoid repetition matching CORS attribute value 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
« no previous file with comments | « Source/core/loader/LinkLoader.h ('k') | Source/core/loader/TextTrackLoader.h » ('j') | 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..8517a62cfd7317e91e39c4ab83a5f08b72ce5e10 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 AtomicString& crossOriginMode, const String& type, const KURL& href, Document& document)
{
if (relAttribute.isDNSPrefetch()) {
Settings* settings = document.settings();
@@ -114,6 +114,8 @@ 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())
+ linkRequest.setCrossOriginAccessControl(document.securityOrigin(), crossOriginMode);
setResource(document.fetcher()->fetchLinkResource(type, linkRequest));
}
« no previous file with comments | « Source/core/loader/LinkLoader.h ('k') | Source/core/loader/TextTrackLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698