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

Unified Diff: Source/core/html/parser/HTMLResourcePreloader.cpp

Issue 243793006: HTML Imports: Teach preloader about HTML Imports. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/html/parser/HTMLPreloadScanner.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLResourcePreloader.cpp
diff --git a/Source/core/html/parser/HTMLResourcePreloader.cpp b/Source/core/html/parser/HTMLResourcePreloader.cpp
index 768576271412324d8be479b122f610df86ef2abf..e712dc1383f656f04f83b5c0d2078e824f7fecf6 100644
--- a/Source/core/html/parser/HTMLResourcePreloader.cpp
+++ b/Source/core/html/parser/HTMLResourcePreloader.cpp
@@ -56,6 +56,13 @@ FetchRequest PreloadRequest::resourceRequest(Document* document)
initiatorInfo.position = m_initiatorPosition;
FetchRequest request(ResourceRequest(completeURL(document)), initiatorInfo);
+ if (m_resourceType == Resource::ImportResource) {
+ bool sameOrigin = document->contextDocument()->securityOrigin()->canRequest(request.url());
+ request.setCrossOriginAccessControl(document->contextDocument()->securityOrigin(),
+ sameOrigin ? AllowStoredCredentials : DoNotAllowStoredCredentials,
+ ClientDidNotRequestCredentials);
+ }
+
if (m_isCORSEnabled)
request.setCrossOriginAccessControl(document->securityOrigin(), m_allowCredentials);
return request;
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScanner.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698