Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |