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

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

Issue 2483703002: Replicate feature policy headers to remote frames (Closed)
Patch Set: Addressing review comments 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) { 86 virtual void setInsecureRequestPolicy(WebInsecureRequestPolicy policy) {
87 m_insecureRequestPolicy = policy; 87 m_insecureRequestPolicy = policy;
88 } 88 }
89 WebInsecureRequestPolicy getInsecureRequestPolicy() const { 89 WebInsecureRequestPolicy getInsecureRequestPolicy() const {
90 return m_insecureRequestPolicy; 90 return m_insecureRequestPolicy;
91 } 91 }
92 92
93 void enforceSuborigin(const Suborigin&); 93 void enforceSuborigin(const Suborigin&);
94 94
95 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); } 95 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); }
96 void setFeaturePolicy(std::unique_ptr<FeaturePolicy> newPolicy) { 96 void setFeaturePolicyForTesting(std::unique_ptr<FeaturePolicy> newPolicy) {
97 m_featurePolicy = std::move(newPolicy); 97 m_featurePolicy = std::move(newPolicy);
98 } 98 }
99 void setFeaturePolicyFromHeader(const String& headerValue,
100 FeaturePolicy* parentFeaturePolicy,
101 Vector<String>* messages = nullptr);
99 102
100 protected: 103 protected:
101 SecurityContext(); 104 SecurityContext();
102 virtual ~SecurityContext(); 105 virtual ~SecurityContext();
103 106
104 void setContentSecurityPolicy(ContentSecurityPolicy*); 107 void setContentSecurityPolicy(ContentSecurityPolicy*);
105 108
106 void applySandboxFlags(SandboxFlags mask); 109 void applySandboxFlags(SandboxFlags mask);
107 110
108 private: 111 private:
109 RefPtr<SecurityOrigin> m_securityOrigin; 112 RefPtr<SecurityOrigin> m_securityOrigin;
110 Member<ContentSecurityPolicy> m_contentSecurityPolicy; 113 Member<ContentSecurityPolicy> m_contentSecurityPolicy;
111 std::unique_ptr<FeaturePolicy> m_featurePolicy; 114 std::unique_ptr<FeaturePolicy> m_featurePolicy;
112 115
113 SandboxFlags m_sandboxFlags; 116 SandboxFlags m_sandboxFlags;
114 117
115 WebAddressSpace m_addressSpace; 118 WebAddressSpace m_addressSpace;
116 WebInsecureRequestPolicy m_insecureRequestPolicy; 119 WebInsecureRequestPolicy m_insecureRequestPolicy;
117 InsecureNavigationsSet m_insecureNavigationsToUpgrade; 120 InsecureNavigationsSet m_insecureNavigationsToUpgrade;
118 }; 121 };
119 122
120 } // namespace blink 123 } // namespace blink
121 124
122 #endif // SecurityContext_h 125 #endif // SecurityContext_h
OLDNEW
« no previous file with comments | « content/test/data/feature-policy2.html.mock-http-headers ('k') | third_party/WebKit/Source/core/dom/SecurityContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698