| 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 initializeFeaturePolicy(const WebParsedFeaturePolicyHeader& parsedHeader, |
| 98 m_featurePolicy = std::move(newPolicy); | 97 const WebFeaturePolicy* parentFeaturePolicy); |
| 99 } | 98 void updateFeaturePolicyOrigin(); |
| 100 void setFeaturePolicyFromHeader( | |
| 101 const WebParsedFeaturePolicyHeader& parsedHeader, | |
| 102 FeaturePolicy* parentFeaturePolicy); | |
| 103 | 99 |
| 104 protected: | 100 protected: |
| 105 SecurityContext(); | 101 SecurityContext(); |
| 106 virtual ~SecurityContext(); | 102 virtual ~SecurityContext(); |
| 107 | 103 |
| 108 void setContentSecurityPolicy(ContentSecurityPolicy*); | 104 void setContentSecurityPolicy(ContentSecurityPolicy*); |
| 109 | 105 |
| 110 void applySandboxFlags(SandboxFlags mask); | 106 void applySandboxFlags(SandboxFlags mask); |
| 111 | 107 |
| 112 private: | 108 private: |
| 113 RefPtr<SecurityOrigin> m_securityOrigin; | 109 RefPtr<SecurityOrigin> m_securityOrigin; |
| 114 Member<ContentSecurityPolicy> m_contentSecurityPolicy; | 110 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
| 115 std::unique_ptr<FeaturePolicy> m_featurePolicy; | 111 std::unique_ptr<WebFeaturePolicy> m_featurePolicy; |
| 116 | 112 |
| 117 SandboxFlags m_sandboxFlags; | 113 SandboxFlags m_sandboxFlags; |
| 118 | 114 |
| 119 WebAddressSpace m_addressSpace; | 115 WebAddressSpace m_addressSpace; |
| 120 WebInsecureRequestPolicy m_insecureRequestPolicy; | 116 WebInsecureRequestPolicy m_insecureRequestPolicy; |
| 121 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 117 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
| 122 }; | 118 }; |
| 123 | 119 |
| 124 } // namespace blink | 120 } // namespace blink |
| 125 | 121 |
| 126 #endif // SecurityContext_h | 122 #endif // SecurityContext_h |
| OLD | NEW |