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 15 matching lines...) Expand all Loading... |
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" | 32 #include "platform/feature_policy/FeaturePolicy.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 #include "platform/weborigin/Suborigin.h" | 34 #include "platform/weborigin/Suborigin.h" |
35 #include "public/platform/WebAddressSpace.h" | 35 #include "public/platform/WebAddressSpace.h" |
| 36 #include "public/platform/WebFeaturePolicy.h" |
36 #include "public/platform/WebInsecureRequestPolicy.h" | 37 #include "public/platform/WebInsecureRequestPolicy.h" |
37 #include "public/platform/WebURLRequest.h" | 38 #include "public/platform/WebURLRequest.h" |
38 #include "wtf/HashSet.h" | 39 #include "wtf/HashSet.h" |
39 #include "wtf/Noncopyable.h" | 40 #include "wtf/Noncopyable.h" |
40 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
42 #include "wtf/text/StringHash.h" | 43 #include "wtf/text/StringHash.h" |
43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
44 | 45 |
45 #include <memory> | 46 #include <memory> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 WebInsecureRequestPolicy getInsecureRequestPolicy() const { | 90 WebInsecureRequestPolicy getInsecureRequestPolicy() const { |
90 return m_insecureRequestPolicy; | 91 return m_insecureRequestPolicy; |
91 } | 92 } |
92 | 93 |
93 void enforceSuborigin(const Suborigin&); | 94 void enforceSuborigin(const Suborigin&); |
94 | 95 |
95 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); } | 96 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); } |
96 void setFeaturePolicyForTesting(std::unique_ptr<FeaturePolicy> newPolicy) { | 97 void setFeaturePolicyForTesting(std::unique_ptr<FeaturePolicy> newPolicy) { |
97 m_featurePolicy = std::move(newPolicy); | 98 m_featurePolicy = std::move(newPolicy); |
98 } | 99 } |
99 void setFeaturePolicyFromHeader(const String& headerValue, | 100 void setFeaturePolicyFromHeader(const WebParsedFeaturePolicy& parsedHeader, |
100 FeaturePolicy* parentFeaturePolicy, | 101 FeaturePolicy* parentFeaturePolicy); |
101 Vector<String>* messages = nullptr); | |
102 | 102 |
103 protected: | 103 protected: |
104 SecurityContext(); | 104 SecurityContext(); |
105 virtual ~SecurityContext(); | 105 virtual ~SecurityContext(); |
106 | 106 |
107 void setContentSecurityPolicy(ContentSecurityPolicy*); | 107 void setContentSecurityPolicy(ContentSecurityPolicy*); |
108 | 108 |
109 void applySandboxFlags(SandboxFlags mask); | 109 void applySandboxFlags(SandboxFlags mask); |
110 | 110 |
111 private: | 111 private: |
112 RefPtr<SecurityOrigin> m_securityOrigin; | 112 RefPtr<SecurityOrigin> m_securityOrigin; |
113 Member<ContentSecurityPolicy> m_contentSecurityPolicy; | 113 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
114 std::unique_ptr<FeaturePolicy> m_featurePolicy; | 114 std::unique_ptr<FeaturePolicy> m_featurePolicy; |
115 | 115 |
116 SandboxFlags m_sandboxFlags; | 116 SandboxFlags m_sandboxFlags; |
117 | 117 |
118 WebAddressSpace m_addressSpace; | 118 WebAddressSpace m_addressSpace; |
119 WebInsecureRequestPolicy m_insecureRequestPolicy; | 119 WebInsecureRequestPolicy m_insecureRequestPolicy; |
120 InsecureNavigationsSet m_insecureNavigationsToUpgrade; | 120 InsecureNavigationsSet m_insecureNavigationsToUpgrade; |
121 }; | 121 }; |
122 | 122 |
123 } // namespace blink | 123 } // namespace blink |
124 | 124 |
125 #endif // SecurityContext_h | 125 #endif // SecurityContext_h |
OLD | NEW |