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

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

Issue 976263002: HTML Imports: Teach preloader about HTML Imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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/HTMLResourcePreloader.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/PreloadRequest.cpp
diff --git a/Source/core/html/parser/PreloadRequest.cpp b/Source/core/html/parser/PreloadRequest.cpp
index 9da71dc9c1e79640e2cc11bf0ec5361c13542a12..4672710f72c5e7ff014d55f5cf7798225fc6a7fa 100644
--- a/Source/core/html/parser/PreloadRequest.cpp
+++ b/Source/core/html/parser/PreloadRequest.cpp
@@ -31,6 +31,14 @@ FetchRequest PreloadRequest::resourceRequest(Document* document)
initiatorInfo.position = m_initiatorPosition;
FetchRequest request(ResourceRequest(completeURL(document)), initiatorInfo);
+ if (m_resourceType == Resource::ImportResource) {
+ SecurityOrigin* securityOrigin = document->contextDocument()->securityOrigin();
+ bool sameOrigin = securityOrigin->canRequest(request.url());
+ request.setCrossOriginAccessControl(securityOrigin,
+ sameOrigin ? AllowStoredCredentials : DoNotAllowStoredCredentials,
+ ClientDidNotRequestCredentials);
+ }
+
if (m_isCORSEnabled)
request.setCrossOriginAccessControl(document->securityOrigin(), m_allowCredentials);
« no previous file with comments | « Source/core/html/parser/HTMLResourcePreloader.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698