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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2128503002: Set 'ResourceRequest::requestorOrigin' in Blink. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yay Created 4 years, 5 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
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 7838ecc56c0258ad735f9755e53c7803e841bc2c..b8d4946be8cbadb94f4ebb1b8c96f0426be17503 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -748,6 +748,21 @@ void FrameFetchContext::addCSPHeaderIfNecessary(Resource::Type type, FetchReques
fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active");
}
+void FrameFetchContext::populateRequestData(ResourceRequest& request)
+{
+ if (!m_document)
+ return;
+
+ // Subresource requests inherit their requestor origin from |m_document| directly.
+ // Top-level and nested frame types are taken care of in 'FrameLoadRequest()'.
+ // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'.
+ if (request.frameType() == WebURLRequest::FrameTypeNone && !request.requestorOrigin()) {
+ request.setRequestorOrigin(m_document->getSecurityOrigin());
+ if (m_document->getSecurityOrigin()->isUnique())
+ request.setRequestorOrigin(SecurityOrigin::create(m_document->url()));
nasko 2016/07/18 23:34:43 I don't grok Blink as well, but if the document or
+ }
+}
+
MHTMLArchive* FrameFetchContext::archive() const
{
ASSERT(!isMainFrame());

Powered by Google App Engine
This is Rietveld 408576698