Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: third_party/WebKit/Source/core/dom/SecurityContext.h

Issue 2481653002: Move FeaturePolicy object to SecurityContext (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
32 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
33 #include "platform/weborigin/Suborigin.h" 34 #include "platform/weborigin/Suborigin.h"
34 #include "public/platform/WebAddressSpace.h" 35 #include "public/platform/WebAddressSpace.h"
35 #include "public/platform/WebInsecureRequestPolicy.h" 36 #include "public/platform/WebInsecureRequestPolicy.h"
36 #include "public/platform/WebURLRequest.h" 37 #include "public/platform/WebURLRequest.h"
37 #include "wtf/HashSet.h" 38 #include "wtf/HashSet.h"
38 #include "wtf/Noncopyable.h" 39 #include "wtf/Noncopyable.h"
39 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
40 #include "wtf/RefPtr.h" 41 #include "wtf/RefPtr.h"
41 #include "wtf/text/StringHash.h" 42 #include "wtf/text/StringHash.h"
42 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
43 44
45 #include <memory>
46
44 namespace blink { 47 namespace blink {
45 48
46 class SecurityOrigin; 49 class SecurityOrigin;
47 class ContentSecurityPolicy; 50 class ContentSecurityPolicy;
48 51
49 class CORE_EXPORT SecurityContext : public GarbageCollectedMixin { 52 class CORE_EXPORT SecurityContext : public GarbageCollectedMixin {
50 WTF_MAKE_NONCOPYABLE(SecurityContext); 53 WTF_MAKE_NONCOPYABLE(SecurityContext);
51 54
52 public: 55 public:
53 DECLARE_VIRTUAL_TRACE(); 56 DECLARE_VIRTUAL_TRACE();
(...skipping 28 matching lines...) Expand all
82 85
83 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) { 86 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) {
84 m_insecureRequestPolicy = policy; 87 m_insecureRequestPolicy = policy;
85 } 88 }
86 WebInsecureRequestPolicy getInsecureRequestPolicy() const { 89 WebInsecureRequestPolicy getInsecureRequestPolicy() const {
87 return m_insecureRequestPolicy; 90 return m_insecureRequestPolicy;
88 } 91 }
89 92
90 void enforceSuborigin(const Suborigin&); 93 void enforceSuborigin(const Suborigin&);
91 94
95 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); }
96 void setFeaturePolicy(std::unique_ptr<FeaturePolicy> newPolicy) {
97 m_featurePolicy = std::move(newPolicy);
98 }
99
92 protected: 100 protected:
93 SecurityContext(); 101 SecurityContext();
94 virtual ~SecurityContext(); 102 virtual ~SecurityContext();
95 103
96 void setContentSecurityPolicy(ContentSecurityPolicy*); 104 void setContentSecurityPolicy(ContentSecurityPolicy*);
97 105
98 void applySandboxFlags(SandboxFlags mask); 106 void applySandboxFlags(SandboxFlags mask);
99 107
100 private: 108 private:
101 RefPtr<SecurityOrigin> m_securityOrigin; 109 RefPtr<SecurityOrigin> m_securityOrigin;
102 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 110 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
111 std::unique_ptr<FeaturePolicy> m_featurePolicy;
103 112
104 SandboxFlags m_sandboxFlags; 113 SandboxFlags m_sandboxFlags;
105 114
106 WebAddressSpace m_addressSpace; 115 WebAddressSpace m_addressSpace;
107 WebInsecureRequestPolicy m_insecureRequestPolicy; 116 WebInsecureRequestPolicy m_insecureRequestPolicy;
108 InsecureNavigationsSet m_insecureNavigationsToUpgrade; 117 InsecureNavigationsSet m_insecureNavigationsToUpgrade;
109 }; 118 };
110 119
111 } // namespace blink 120 } // namespace blink
112 121
113 #endif // SecurityContext_h 122 #endif // SecurityContext_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp ('k') | third_party/WebKit/Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698