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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 559503002: CSP: Move policy parsing out of Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698