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

Unified Diff: Source/web/WebEmbeddedWorkerImpl.cpp

Issue 594803002: Transfer SecurityOrigin overrides to Workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add tests Created 6 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: Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/Source/web/WebEmbeddedWorkerImpl.cpp b/Source/web/WebEmbeddedWorkerImpl.cpp
index a9b82e734e3fb8a5a0780503e83aa88f07a42d4e..8be891d7268e71b19bc08a34f34e89b3f3c3089f 100644
--- a/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -402,6 +402,10 @@ void WebEmbeddedWorkerImpl::startWorkerThread()
if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document))
startMode = PauseWorkerGlobalScopeOnStart;
+ SecurityOrigin::PolicyOverrides originPolicyOverrides;
+ if (document->securityOrigin())
horo 2014/09/24 05:42:27 I think WebEmbeddedWorkerImpl's m_mainFrame is not
sof 2014/09/28 17:10:22 Thanks, I missed that -- the document for the shad
+ originPolicyOverrides = document->securityOrigin()->policyOverrides();
+
OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create();
providePermissionClientToWorker(workerClients.get(), m_permissionClient.release());
provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWorkerGlobalScopeClientImpl::create(*m_workerContextClient));
@@ -416,6 +420,7 @@ void WebEmbeddedWorkerImpl::startWorkerThread()
// FIXME: fill appropriate CSP info and policy type.
String(),
ContentSecurityPolicyHeaderTypeEnforce,
+ originPolicyOverrides,
workerClients.release());
m_mainScriptLoader.clear();

Powered by Google App Engine
This is Rietveld 408576698