OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google, Inc. All rights reserved. | 2 * Copyright (C) 2011 Google, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ContentSecurityPolicy_h | 26 #ifndef ContentSecurityPolicy_h |
27 #define ContentSecurityPolicy_h | 27 #define ContentSecurityPolicy_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptState.h" | 29 #include "bindings/core/v8/ScriptState.h" |
30 #include "core/dom/ExecutionContext.h" | 30 #include "core/dom/ExecutionContext.h" |
31 #include "platform/network/ContentSecurityPolicyParsers.h" | 31 #include "platform/network/ContentSecurityPolicyParsers.h" |
32 #include "platform/network/HTTPParsers.h" | 32 #include "platform/network/HTTPParsers.h" |
33 #include "platform/weborigin/ReferrerPolicy.h" | 33 #include "platform/weborigin/ReferrerPolicy.h" |
| 34 #include "public/platform/WebURLRequest.h" |
34 #include "wtf/HashSet.h" | 35 #include "wtf/HashSet.h" |
35 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
36 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
37 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
40 #include "wtf/text/TextPosition.h" | 41 #include "wtf/text/TextPosition.h" |
41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
42 | 43 |
43 namespace WTF { | 44 namespace WTF { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const String& deprecatedHeader() const; | 104 const String& deprecatedHeader() const; |
104 ContentSecurityPolicyHeaderType deprecatedHeaderType() const; | 105 ContentSecurityPolicyHeaderType deprecatedHeaderType() const; |
105 | 106 |
106 bool allowJavaScriptURLs(const String& contextURL, const WTF::OrdinalNumber&
contextLine, ReportingStatus = SendReport) const; | 107 bool allowJavaScriptURLs(const String& contextURL, const WTF::OrdinalNumber&
contextLine, ReportingStatus = SendReport) const; |
107 bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNu
mber& contextLine, ReportingStatus = SendReport) const; | 108 bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNu
mber& contextLine, ReportingStatus = SendReport) const; |
108 bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& c
ontextLine, ReportingStatus = SendReport) const; | 109 bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& c
ontextLine, ReportingStatus = SendReport) const; |
109 bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& co
ntextLine, ReportingStatus = SendReport) const; | 110 bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& co
ntextLine, ReportingStatus = SendReport) const; |
110 bool allowEval(ScriptState* = 0, ReportingStatus = SendReport) const; | 111 bool allowEval(ScriptState* = 0, ReportingStatus = SendReport) const; |
111 bool allowPluginType(const String& type, const String& typeAttribute, const
KURL&, ReportingStatus = SendReport) const; | 112 bool allowPluginType(const String& type, const String& typeAttribute, const
KURL&, ReportingStatus = SendReport) const; |
112 | 113 |
| 114 bool allowFromSource(const KURL&, blink::WebURLRequest::RequestContext, Repo
rtingStatus = SendReport) const; |
| 115 |
113 bool allowScriptFromSource(const KURL&, ReportingStatus = SendReport) const; | 116 bool allowScriptFromSource(const KURL&, ReportingStatus = SendReport) const; |
114 bool allowObjectFromSource(const KURL&, ReportingStatus = SendReport) const; | 117 bool allowObjectFromSource(const KURL&, ReportingStatus = SendReport) const; |
115 bool allowChildFrameFromSource(const KURL&, ReportingStatus = SendReport) co
nst; | 118 bool allowChildFrameFromSource(const KURL&, ReportingStatus = SendReport) co
nst; |
116 bool allowImageFromSource(const KURL&, ReportingStatus = SendReport) const; | 119 bool allowImageFromSource(const KURL&, ReportingStatus = SendReport) const; |
117 bool allowStyleFromSource(const KURL&, ReportingStatus = SendReport) const; | 120 bool allowStyleFromSource(const KURL&, ReportingStatus = SendReport) const; |
118 bool allowFontFromSource(const KURL&, ReportingStatus = SendReport) const; | 121 bool allowFontFromSource(const KURL&, ReportingStatus = SendReport) const; |
119 bool allowMediaFromSource(const KURL&, ReportingStatus = SendReport) const; | 122 bool allowMediaFromSource(const KURL&, ReportingStatus = SendReport) const; |
120 bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const; | 123 bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const; |
121 bool allowFormAction(const KURL&, ReportingStatus = SendReport) const; | 124 bool allowFormAction(const KURL&, ReportingStatus = SendReport) const; |
122 bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const; | 125 bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // We put the hash functions used on the policy object so that we only need | 202 // We put the hash functions used on the policy object so that we only need |
200 // to calculate a hash once and then distribute it to all of the directives | 203 // to calculate a hash once and then distribute it to all of the directives |
201 // for validation. | 204 // for validation. |
202 uint8_t m_scriptHashAlgorithmsUsed; | 205 uint8_t m_scriptHashAlgorithmsUsed; |
203 uint8_t m_styleHashAlgorithmsUsed; | 206 uint8_t m_styleHashAlgorithmsUsed; |
204 }; | 207 }; |
205 | 208 |
206 } | 209 } |
207 | 210 |
208 #endif | 211 #endif |
OLD | NEW |