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

Side by Side Diff: Source/core/workers/WorkerScriptLoaderClient.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 unified diff | Download patch
« no previous file with comments | « Source/core/workers/WorkerScriptLoaderClient.h ('k') | Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/workers/WorkerScriptLoaderClient.h"
7
8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
10 #include "platform/network/ResourceResponse.h"
11
12 namespace blink {
13
14 WorkerScriptLoaderClient::~WorkerScriptLoaderClient()
15 {
16 }
17
18 PassRefPtr<ContentSecurityPolicy> WorkerScriptLoaderClient::contentSecurityPolic y()
19 {
20 return m_contentSecurityPolicy;
21 }
22
23 void WorkerScriptLoaderClient::processContentSecurityPolicy(const ResourceRespon se& response)
24 {
25 if (!response.url().protocolIs("blob") && !response.url().protocolIs("file") && !response.url().protocolIs("filesystem")) {
Mike West 2015/05/15 11:54:43 Nit: At some point in the future, we should extrac
estark 2015/05/18 16:24:15 Acknowledged.
26 m_contentSecurityPolicy = ContentSecurityPolicy::create();
27 m_contentSecurityPolicy->setOverrideURLForSelf(response.url());
28 m_contentSecurityPolicy->didReceiveHeaders(ContentSecurityPolicyResponse Headers(response));
29 }
30 }
31
32 void WorkerScriptLoaderClient::setContentSecurityPolicy(PassRefPtr<ContentSecuri tyPolicy> contentSecurityPolicy)
33 {
34 m_contentSecurityPolicy = contentSecurityPolicy;
35 }
36
37 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerScriptLoaderClient.h ('k') | Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698