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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ResourceLoaderOptions_h | 31 #ifndef ResourceLoaderOptions_h |
32 #define ResourceLoaderOptions_h | 32 #define ResourceLoaderOptions_h |
33 | 33 |
34 #include "core/fetch/FetchInitiatorInfo.h" | 34 #include "core/fetch/FetchInitiatorInfo.h" |
| 35 #include "core/fetch/IntegrityMetadata.h" |
35 #include "platform/CrossThreadCopier.h" | 36 #include "platform/CrossThreadCopier.h" |
36 #include "platform/weborigin/SecurityOrigin.h" | 37 #include "platform/weborigin/SecurityOrigin.h" |
37 #include "wtf/Allocator.h" | 38 #include "wtf/Allocator.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 enum DataBufferingPolicy { | 42 enum DataBufferingPolicy { |
42 BufferData, | 43 BufferData, |
43 DoNotBufferData | 44 DoNotBufferData |
44 }; | 45 }; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 DataBufferingPolicy dataBufferingPolicy; | 131 DataBufferingPolicy dataBufferingPolicy; |
131 StoredCredentials allowCredentials; // Whether HTTP credentials and cookies
are sent with the request. | 132 StoredCredentials allowCredentials; // Whether HTTP credentials and cookies
are sent with the request. |
132 CredentialRequest credentialsRequested; // Whether the client (e.g. XHR) wan
ted credentials in the first place. | 133 CredentialRequest credentialsRequested; // Whether the client (e.g. XHR) wan
ted credentials in the first place. |
133 ContentSecurityPolicyDisposition contentSecurityPolicyOption; | 134 ContentSecurityPolicyDisposition contentSecurityPolicyOption; |
134 FetchInitiatorInfo initiatorInfo; | 135 FetchInitiatorInfo initiatorInfo; |
135 RequestInitiatorContext requestInitiatorContext; | 136 RequestInitiatorContext requestInitiatorContext; |
136 SynchronousPolicy synchronousPolicy; | 137 SynchronousPolicy synchronousPolicy; |
137 CORSEnabled corsEnabled; // If the resource is loaded out-of-origin, whether
or not to use CORS. | 138 CORSEnabled corsEnabled; // If the resource is loaded out-of-origin, whether
or not to use CORS. |
138 RefPtr<SecurityOrigin> securityOrigin; | 139 RefPtr<SecurityOrigin> securityOrigin; |
139 String contentSecurityPolicyNonce; | 140 String contentSecurityPolicyNonce; |
| 141 IntegrityMetadataSet integrityMetadata; |
140 }; | 142 }; |
141 | 143 |
142 // Encode AtomicString (in FetchInitiatorInfo) as String to cross threads. | 144 // Encode AtomicString (in FetchInitiatorInfo) as String to cross threads. |
143 struct CrossThreadResourceLoaderOptionsData { | 145 struct CrossThreadResourceLoaderOptionsData { |
144 DISALLOW_NEW(); | 146 DISALLOW_NEW(); |
145 explicit CrossThreadResourceLoaderOptionsData(const ResourceLoaderOptions& o
ptions) | 147 explicit CrossThreadResourceLoaderOptionsData(const ResourceLoaderOptions& o
ptions) |
146 : dataBufferingPolicy(options.dataBufferingPolicy) | 148 : dataBufferingPolicy(options.dataBufferingPolicy) |
147 , allowCredentials(options.allowCredentials) | 149 , allowCredentials(options.allowCredentials) |
148 , credentialsRequested(options.credentialsRequested) | 150 , credentialsRequested(options.credentialsRequested) |
149 , contentSecurityPolicyOption(options.contentSecurityPolicyOption) | 151 , contentSecurityPolicyOption(options.contentSecurityPolicyOption) |
150 , initiatorInfo(options.initiatorInfo) | 152 , initiatorInfo(options.initiatorInfo) |
151 , requestInitiatorContext(options.requestInitiatorContext) | 153 , requestInitiatorContext(options.requestInitiatorContext) |
152 , synchronousPolicy(options.synchronousPolicy) | 154 , synchronousPolicy(options.synchronousPolicy) |
153 , corsEnabled(options.corsEnabled) | 155 , corsEnabled(options.corsEnabled) |
154 , securityOrigin(options.securityOrigin ? options.securityOrigin->isolat
edCopy() : nullptr) | 156 , securityOrigin(options.securityOrigin ? options.securityOrigin->isolat
edCopy() : nullptr) |
155 , contentSecurityPolicyNonce(options.contentSecurityPolicyNonce) | 157 , contentSecurityPolicyNonce(options.contentSecurityPolicyNonce) |
| 158 , integrityMetadata(options.integrityMetadata) |
156 { | 159 { |
157 } | 160 } |
158 | 161 |
159 operator ResourceLoaderOptions() const | 162 operator ResourceLoaderOptions() const |
160 { | 163 { |
161 ResourceLoaderOptions options; | 164 ResourceLoaderOptions options; |
162 options.dataBufferingPolicy = dataBufferingPolicy; | 165 options.dataBufferingPolicy = dataBufferingPolicy; |
163 options.allowCredentials = allowCredentials; | 166 options.allowCredentials = allowCredentials; |
164 options.credentialsRequested = credentialsRequested; | 167 options.credentialsRequested = credentialsRequested; |
165 options.contentSecurityPolicyOption = contentSecurityPolicyOption; | 168 options.contentSecurityPolicyOption = contentSecurityPolicyOption; |
166 options.initiatorInfo = initiatorInfo; | 169 options.initiatorInfo = initiatorInfo; |
167 options.requestInitiatorContext = requestInitiatorContext; | 170 options.requestInitiatorContext = requestInitiatorContext; |
168 options.synchronousPolicy = synchronousPolicy; | 171 options.synchronousPolicy = synchronousPolicy; |
169 options.corsEnabled = corsEnabled; | 172 options.corsEnabled = corsEnabled; |
170 options.securityOrigin = securityOrigin; | 173 options.securityOrigin = securityOrigin; |
171 options.contentSecurityPolicyNonce = contentSecurityPolicyNonce; | 174 options.contentSecurityPolicyNonce = contentSecurityPolicyNonce; |
| 175 options.integrityMetadata = integrityMetadata; |
172 return options; | 176 return options; |
173 } | 177 } |
174 | 178 |
175 DataBufferingPolicy dataBufferingPolicy; | 179 DataBufferingPolicy dataBufferingPolicy; |
176 StoredCredentials allowCredentials; | 180 StoredCredentials allowCredentials; |
177 CredentialRequest credentialsRequested; | 181 CredentialRequest credentialsRequested; |
178 ContentSecurityPolicyDisposition contentSecurityPolicyOption; | 182 ContentSecurityPolicyDisposition contentSecurityPolicyOption; |
179 CrossThreadFetchInitiatorInfoData initiatorInfo; | 183 CrossThreadFetchInitiatorInfoData initiatorInfo; |
180 RequestInitiatorContext requestInitiatorContext; | 184 RequestInitiatorContext requestInitiatorContext; |
181 SynchronousPolicy synchronousPolicy; | 185 SynchronousPolicy synchronousPolicy; |
182 CORSEnabled corsEnabled; | 186 CORSEnabled corsEnabled; |
183 RefPtr<SecurityOrigin> securityOrigin; | 187 RefPtr<SecurityOrigin> securityOrigin; |
184 String contentSecurityPolicyNonce; | 188 String contentSecurityPolicyNonce; |
| 189 IntegrityMetadataSet integrityMetadata; |
185 }; | 190 }; |
186 | 191 |
187 template <> | 192 template <> |
188 struct CrossThreadCopier<ResourceLoaderOptions> { | 193 struct CrossThreadCopier<ResourceLoaderOptions> { |
189 using Type = CrossThreadResourceLoaderOptionsData; | 194 using Type = CrossThreadResourceLoaderOptionsData; |
190 static Type copy(const ResourceLoaderOptions& options) | 195 static Type copy(const ResourceLoaderOptions& options) |
191 { | 196 { |
192 return CrossThreadResourceLoaderOptionsData(options); | 197 return CrossThreadResourceLoaderOptionsData(options); |
193 } | 198 } |
194 }; | 199 }; |
195 | 200 |
196 } // namespace blink | 201 } // namespace blink |
197 | 202 |
198 #endif // ResourceLoaderOptions_h | 203 #endif // ResourceLoaderOptions_h |
OLD | NEW |