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

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

Issue 2332023002: Correctly set requestor origin for worker initiated requests. (Closed)
Patch Set: Created 4 years, 3 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 1d8a489187bf24ba71847999558509e59898b068..f869b9d31e0dc0d4f16957ab1ecea014fece61bf 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -753,7 +753,11 @@ void FrameFetchContext::populateRequestData(ResourceRequest& request)
// 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()) {
+ //
+ // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to
+ // initialize itself with a `nullptr` initiator so that this can be a simple
+ // `isNull()` check. https://crbug.com/625969
+ if (request.frameType() == WebURLRequest::FrameTypeNone && request.requestorOrigin()->isUnique()) {
request.setRequestorOrigin(m_document->isSandboxed(SandboxOrigin)
? SecurityOrigin::create(m_document->url())
: m_document->getSecurityOrigin());

Powered by Google App Engine
This is Rietveld 408576698