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

Side by Side Diff: Source/core/workers/WorkerScriptLoaderClient.h

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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 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 11 matching lines...) Expand all
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28 #ifndef WorkerScriptLoaderClient_h 28 #ifndef WorkerScriptLoaderClient_h
29 #define WorkerScriptLoaderClient_h 29 #define WorkerScriptLoaderClient_h
30 30
31 #include "core/CoreExport.h" 31 #include "core/CoreExport.h"
32 #include "wtf/RefPtr.h"
32 33
33 namespace blink { 34 namespace blink {
34 35
36 class ContentSecurityPolicy;
35 class ResourceResponse; 37 class ResourceResponse;
36 38
37 class CORE_EXPORT WorkerScriptLoaderClient { 39 class CORE_EXPORT WorkerScriptLoaderClient {
38 public: 40 public:
39 virtual void didReceiveResponse(unsigned long /*identifier*/, const Resource Response&) { } 41 virtual void didReceiveResponse(unsigned long /*identifier*/, const Resource Response&) { }
40 42
41 // FIXME: notifyFinished() is not currently guaranteed to be invoked if used from worker context and the worker shuts down in the middle of an operation. 43 // FIXME: notifyFinished() is not currently guaranteed to be invoked if used from worker context and the worker shuts down in the middle of an operation.
42 // This will cause leaks when we support nested workers. 44 // This will cause leaks when we support nested workers.
43 virtual void notifyFinished() { } 45 virtual void notifyFinished() { }
44 46
47 PassRefPtr<ContentSecurityPolicy> contentSecurityPolicy();
48
45 protected: 49 protected:
46 virtual ~WorkerScriptLoaderClient() { } 50 virtual ~WorkerScriptLoaderClient();
51
52 void processContentSecurityPolicy(const ResourceResponse&);
53 void setContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy>);
54
55 private:
56 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy;
47 }; 57 };
48 58
49 } // namespace blink 59 } // namespace blink
50 60
51 #endif // WorkerScriptLoaderClient_h 61 #endif // WorkerScriptLoaderClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698