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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #ifndef SecurityContext_h | 27 #ifndef SecurityContext_h |
28 #define SecurityContext_h | 28 #define SecurityContext_h |
29 | 29 |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
31 #include "core/dom/SandboxFlags.h" | 31 #include "core/dom/SandboxFlags.h" |
32 #include "platform/feature_policy/FeaturePolicy.h" | |
33 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
34 #include "platform/weborigin/Suborigin.h" | 33 #include "platform/weborigin/Suborigin.h" |
35 #include "public/platform/WebAddressSpace.h" | 34 #include "public/platform/WebAddressSpace.h" |
36 #include "public/platform/WebFeaturePolicy.h" | 35 #include "public/platform/WebFeaturePolicy.h" |
37 #include "public/platform/WebInsecureRequestPolicy.h" | 36 #include "public/platform/WebInsecureRequestPolicy.h" |
38 #include "public/platform/WebURLRequest.h" | 37 #include "public/platform/WebURLRequest.h" |
39 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
40 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
41 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
42 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 85 |
87 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) { | 86 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) { |
88 m_insecureRequestPolicy = policy; | 87 m_insecureRequestPolicy = policy; |
89 } | 88 } |
90 WebInsecureRequestPolicy getInsecureRequestPolicy() const { | 89 WebInsecureRequestPolicy getInsecureRequestPolicy() const { |
91 return m_insecureRequestPolicy; | 90 return m_insecureRequestPolicy; |
92 } | 91 } |
93 | 92 |
94 void enforceSuborigin(const Suborigin&); | 93 void enforceSuborigin(const Suborigin&); |
95 | 94 |
96 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); } | 95 WebFeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); } |
97 void setFeaturePolicyForTesting(std::unique_ptr<FeaturePolicy> newPolicy) { | 96 void setFeaturePolicyFromHeader( |
98 m_featurePolicy = std::move(newPolicy); | 97 const WebParsedFeaturePolicyHeader& parsedHeader, |
99 } | 98 const WebFeaturePolicy* parentFeaturePolicy); |
100 void setFeaturePolicyFromHeader(const WebParsedFeaturePolicy& parsedHeader, | |
101 FeaturePolicy* parentFeaturePolicy); | |
102 | 99 |
103 protected: | 100 protected: |
104 SecurityContext(); | 101 SecurityContext(); |
105 virtual ~SecurityContext(); | 102 virtual ~SecurityContext(); |
106 | 103 |
107 void setContentSecurityPolicy(ContentSecurityPolicy*); | 104 void setContentSecurityPolicy(ContentSecurityPolicy*); |
108 | 105 |
109 void applySandboxFlags(SandboxFlags mask); | 106 void applySandboxFlags(SandboxFlags mask); |
110 | 107 |
111 private: | 108 private: |
112 RefPtr<SecurityOrigin> m_securityOrigin; | 109 RefPtr<SecurityOrigin> m_securityOrigin; |
113 Member<ContentSecurityPolicy> m_contentSecurityPolicy; | 110 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
114 std::unique_ptr<FeaturePolicy> m_featurePolicy; | 111 std::unique_ptr<WebFeaturePolicy> m_featurePolicy; |
115 | 112 |
116 SandboxFlags m_sandboxFlags; | 113 SandboxFlags m_sandboxFlags; |
117 | 114 |
118 WebAddressSpace m_addressSpace; | 115 WebAddressSpace m_addressSpace; |
119 WebInsecureRequestPolicy m_insecureRequestPolicy; | 116 WebInsecureRequestPolicy m_insecureRequestPolicy; |
120 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 117 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
121 }; | 118 }; |
122 | 119 |
123 } // namespace blink | 120 } // namespace blink |
124 | 121 |
125 #endif // SecurityContext_h | 122 #endif // SecurityContext_h |
OLD | NEW |