OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef FeaturePolicy_h | 5 #ifndef FeaturePolicy_h |
6 #define FeaturePolicy_h | 6 #define FeaturePolicy_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/weborigin/SecurityOrigin.h" | 9 #include "platform/weborigin/SecurityOrigin.h" |
10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // the policy. | 138 // the policy. |
139 bool isFeatureEnabled(const Feature&) const; | 139 bool isFeatureEnabled(const Feature&) const; |
140 | 140 |
141 // Returns the list of features which can be controlled by Feature Policy. | 141 // Returns the list of features which can be controlled by Feature Policy. |
142 static FeatureList& getDefaultFeatureList(); | 142 static FeatureList& getDefaultFeatureList(); |
143 | 143 |
144 String toString(); | 144 String toString(); |
145 | 145 |
146 private: | 146 private: |
147 friend class FeaturePolicyTest; | 147 friend class FeaturePolicyTest; |
| 148 friend class FeaturePolicyInFrameTest; |
148 | 149 |
149 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features); | 150 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features); |
150 | 151 |
151 static std::unique_ptr<FeaturePolicy> createFromParentPolicy( | 152 static std::unique_ptr<FeaturePolicy> createFromParentPolicy( |
152 const FeaturePolicy* parent, | 153 const FeaturePolicy* parent, |
153 RefPtr<SecurityOrigin>, | 154 RefPtr<SecurityOrigin>, |
154 FeatureList& features); | 155 FeatureList& features); |
155 | 156 |
156 RefPtr<SecurityOrigin> m_origin; | 157 RefPtr<SecurityOrigin> m_origin; |
157 | 158 |
(...skipping 25 matching lines...) Expand all Loading... |
183 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature; | 184 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature; |
184 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript; | 185 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript; |
185 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR; | 186 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR; |
186 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia; | 187 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia; |
187 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature; | 188 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature; |
188 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC; | 189 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC; |
189 | 190 |
190 } // namespace blink | 191 } // namespace blink |
191 | 192 |
192 #endif // FeaturePolicy_h | 193 #endif // FeaturePolicy_h |
OLD | NEW |