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

Unified Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 2086143006: Implement Referrer-Policy header for workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix shared worker path Created 4 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
Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index 3cf2fe172c05be0e8a117e52b7977bf6bfbc530a..66977e88796468fd53b77ecfa28cc9da0b3f32ea 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -412,6 +412,8 @@ void WebEmbeddedWorkerImpl::startWorkerThread()
// We need to set the CSP to both the shadow page's document and the ServiceWorkerGlobalScope.
document->initContentSecurityPolicy(m_mainScriptLoader->releaseContentSecurityPolicy());
+ if (!m_mainScriptLoader->referrerPolicy().isNull())
+ document->parseAndSetReferrerPolicy(m_mainScriptLoader->referrerPolicy());
KURL scriptURL = m_mainScriptLoader->url();
WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(document);
@@ -423,6 +425,7 @@ void WebEmbeddedWorkerImpl::startWorkerThread()
m_mainScriptLoader->releaseCachedMetadata(),
startMode,
document->contentSecurityPolicy()->headers().get(),
+ m_mainScriptLoader->referrerPolicy(),
starterOrigin,
workerClients,
m_mainScriptLoader->responseAddressSpace(),

Powered by Google App Engine
This is Rietveld 408576698