OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 ConsiderPreflight, | 55 ConsiderPreflight, |
56 ForcePreflight, | 56 ForcePreflight, |
57 PreventPreflight | 57 PreventPreflight |
58 }; | 58 }; |
59 | 59 |
60 enum ContentSecurityPolicyEnforcement { | 60 enum ContentSecurityPolicyEnforcement { |
61 EnforceContentSecurityPolicy, | 61 EnforceContentSecurityPolicy, |
62 DoNotEnforceContentSecurityPolicy, | 62 DoNotEnforceContentSecurityPolicy, |
63 }; | 63 }; |
64 | 64 |
| 65 // Instructs whether or not to include the Origin header in same-origin |
| 66 // requests. |
| 67 enum SameOriginHeaderPolicy { |
| 68 IncludeSameOriginHeader, |
| 69 OmitSameOriginHeader, |
| 70 }; |
| 71 |
65 struct ThreadableLoaderOptions { | 72 struct ThreadableLoaderOptions { |
66 DISALLOW_NEW(); | 73 DISALLOW_NEW(); |
67 ThreadableLoaderOptions() | 74 ThreadableLoaderOptions() |
68 : preflightPolicy(ConsiderPreflight) | 75 : preflightPolicy(ConsiderPreflight) |
69 , crossOriginRequestPolicy(DenyCrossOriginRequests) | 76 , crossOriginRequestPolicy(DenyCrossOriginRequests) |
70 , contentSecurityPolicyEnforcement(EnforceContentSecurityPolicy) | 77 , contentSecurityPolicyEnforcement(EnforceContentSecurityPolicy) |
71 , timeoutMilliseconds(0) { } | 78 , timeoutMilliseconds(0) |
| 79 , sameOriginHeaderPolicy(OmitSameOriginHeader) { } |
72 | 80 |
73 // When adding members, CrossThreadThreadableLoaderOptionsData should | 81 // When adding members, CrossThreadThreadableLoaderOptionsData should |
74 // be updated. | 82 // be updated. |
75 PreflightPolicy preflightPolicy; // If AccessControl is used, how to determi
ne if a preflight is needed. | 83 PreflightPolicy preflightPolicy; // If AccessControl is used, how to determi
ne if a preflight is needed. |
76 CrossOriginRequestPolicy crossOriginRequestPolicy; | 84 CrossOriginRequestPolicy crossOriginRequestPolicy; |
77 AtomicString initiator; | 85 AtomicString initiator; |
78 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; | 86 ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement; |
79 unsigned long timeoutMilliseconds; | 87 unsigned long timeoutMilliseconds; |
| 88 SameOriginHeaderPolicy sameOriginHeaderPolicy; |
80 }; | 89 }; |
81 | 90 |
82 // Encode AtomicString as String to cross threads. | 91 // Encode AtomicString as String to cross threads. |
83 struct CrossThreadThreadableLoaderOptionsData { | 92 struct CrossThreadThreadableLoaderOptionsData { |
84 STACK_ALLOCATED(); | 93 STACK_ALLOCATED(); |
85 explicit CrossThreadThreadableLoaderOptionsData(const ThreadableLoaderOption
s& options) | 94 explicit CrossThreadThreadableLoaderOptionsData(const ThreadableLoaderOption
s& options) |
86 : preflightPolicy(options.preflightPolicy) | 95 : preflightPolicy(options.preflightPolicy) |
87 , crossOriginRequestPolicy(options.crossOriginRequestPolicy) | 96 , crossOriginRequestPolicy(options.crossOriginRequestPolicy) |
88 , initiator(options.initiator.getString().isolatedCopy()) | 97 , initiator(options.initiator.getString().isolatedCopy()) |
89 , contentSecurityPolicyEnforcement(options.contentSecurityPolicyEnforcem
ent) | 98 , contentSecurityPolicyEnforcement(options.contentSecurityPolicyEnforcem
ent) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 196 |
188 DEFINE_INLINE_VIRTUAL_TRACE() {} | 197 DEFINE_INLINE_VIRTUAL_TRACE() {} |
189 | 198 |
190 protected: | 199 protected: |
191 ThreadableLoader() { } | 200 ThreadableLoader() { } |
192 }; | 201 }; |
193 | 202 |
194 } // namespace blink | 203 } // namespace blink |
195 | 204 |
196 #endif // ThreadableLoader_h | 205 #endif // ThreadableLoader_h |
OLD | NEW |