Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 m_workerClients->reattachThread(); | 97 m_workerClients->reattachThread(); |
| 98 m_thread->setWorkerInspectorController(m_workerInspectorController.get()); | 98 m_thread->setWorkerInspectorController(m_workerInspectorController.get()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 WorkerGlobalScope::~WorkerGlobalScope() | 101 WorkerGlobalScope::~WorkerGlobalScope() |
| 102 { | 102 { |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WorkerGlobalScope::applyContentSecurityPolicyFromString(const String& polic y, ContentSecurityPolicyHeaderType contentSecurityPolicyType) | 105 void WorkerGlobalScope::applyContentSecurityPolicyFromString(const String& polic y, ContentSecurityPolicyHeaderType contentSecurityPolicyType) |
| 106 { | 106 { |
| 107 setContentSecurityPolicy(ContentSecurityPolicy::create(this)); | 107 // FIXME: This doesn't match the CSP2 spec's Worker behavior (see https://w3 c.github.io/webappsec/specs/content-security-policy/#processing-model-workers) |
| 108 setContentSecurityPolicy(ContentSecurityPolicy::create()); | |
|
sof
2014/09/11 07:44:04
(Nothing wrong with this, but I like the style add
Mike West
2014/09/11 08:29:13
I'll rework it, no worries.
| |
| 108 contentSecurityPolicy()->didReceiveHeader(policy, contentSecurityPolicyType, ContentSecurityPolicyHeaderSourceHTTP); | 109 contentSecurityPolicy()->didReceiveHeader(policy, contentSecurityPolicyType, ContentSecurityPolicyHeaderSourceHTTP); |
| 110 contentSecurityPolicy()->bindToExecutionContext(executionContext()); | |
| 109 } | 111 } |
| 110 | 112 |
| 111 ExecutionContext* WorkerGlobalScope::executionContext() const | 113 ExecutionContext* WorkerGlobalScope::executionContext() const |
| 112 { | 114 { |
| 113 return const_cast<WorkerGlobalScope*>(this); | 115 return const_cast<WorkerGlobalScope*>(this); |
| 114 } | 116 } |
| 115 | 117 |
| 116 const KURL& WorkerGlobalScope::virtualURL() const | 118 const KURL& WorkerGlobalScope::virtualURL() const |
| 117 { | 119 { |
| 118 return m_url; | 120 return m_url; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 visitor->trace(m_workerInspectorController); | 355 visitor->trace(m_workerInspectorController); |
| 354 visitor->trace(m_eventQueue); | 356 visitor->trace(m_eventQueue); |
| 355 visitor->trace(m_workerClients); | 357 visitor->trace(m_workerClients); |
| 356 visitor->trace(m_messageStorage); | 358 visitor->trace(m_messageStorage); |
| 357 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 359 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
| 358 ExecutionContext::trace(visitor); | 360 ExecutionContext::trace(visitor); |
| 359 EventTargetWithInlineData::trace(visitor); | 361 EventTargetWithInlineData::trace(visitor); |
| 360 } | 362 } |
| 361 | 363 |
| 362 } // namespace blink | 364 } // namespace blink |
| OLD | NEW |