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

Unified Diff: Source/core/workers/InProcessWorkerBase.cpp

Issue 1128813003: Give shared workers their own content security policies (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 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/core/workers/InProcessWorkerBase.cpp
diff --git a/Source/core/workers/InProcessWorkerBase.cpp b/Source/core/workers/InProcessWorkerBase.cpp
index 157afdc4a2a21a722bdae721e7ed94d31649d151..8e2ae503e3934f4d96a0e04f8b3c921f7b7c4520 100644
--- a/Source/core/workers/InProcessWorkerBase.cpp
+++ b/Source/core/workers/InProcessWorkerBase.cpp
@@ -78,16 +78,12 @@ bool InProcessWorkerBase::hasPendingActivity() const
PassRefPtr<ContentSecurityPolicy> InProcessWorkerBase::contentSecurityPolicy()
{
- return m_contentSecurityPolicy;
+ return WorkerScriptLoaderClient::contentSecurityPolicy();
}
void InProcessWorkerBase::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
{
- if (!response.url().protocolIs("blob") && !response.url().protocolIs("file") && !response.url().protocolIs("filesystem")) {
- m_contentSecurityPolicy = ContentSecurityPolicy::create();
- m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
- m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponseHeaders(response));
- }
+ processContentSecurityPolicy(response);
InspectorInstrumentation::didReceiveScriptResponse(executionContext(), identifier);
}

Powered by Google App Engine
This is Rietveld 408576698