| 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 9166180f40520e80392a93c590b5a86b542d5cb8..f87dc9811204eb8450b87c5acdd93fe53411ba05 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| @@ -727,6 +727,25 @@ void FrameFetchContext::addCSPHeaderIfNecessary(Resource::Type type, FetchReques
|
| fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active");
|
| }
|
|
|
| +void FrameFetchContext::populateRequestorDataIfNecessary(ResourceRequest& request)
|
| +{
|
| + if (!m_document)
|
| + return;
|
| +
|
| + // Subresource requests inherit their requestor origin and first-party for
|
| + // cookies from |m_document| directly.
|
| + if (request.frameType() == WebURLRequest::FrameTypeNone) {
|
| + RefPtr<SecurityOrigin> documentSite = SecurityOrigin::create(m_document->url());
|
| + if (request.requestorOrigin()->isUnique() && !documentSite->isUnique())
|
| + request.setRequestorOrigin(documentSite);
|
| + if (request.firstPartyForCookies().isEmpty())
|
| + request.setFirstPartyForCookies(m_document->firstPartyForCookies());
|
| + }
|
| +
|
| + // Top-level and nested frame types are taken care of in 'FrameLoadRequest()'.
|
| + // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'.
|
| +}
|
| +
|
| MHTMLArchive* FrameFetchContext::archive() const
|
| {
|
| ASSERT(!isMainFrame());
|
|
|