Chromium Code Reviews| 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 "public/platform/WebFeaturePolicy.h" | 10 #include "public/platform/WebFeaturePolicy.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 149 |
| 150 // Returns whether or not the given feature is enabled for the frame that owns | 150 // Returns whether or not the given feature is enabled for the frame that owns |
| 151 // the policy. | 151 // the policy. |
| 152 bool isFeatureEnabled(const Feature&) const; | 152 bool isFeatureEnabled(const Feature&) const; |
| 153 | 153 |
| 154 // Returns the list of features which can be controlled by Feature Policy. | 154 // Returns the list of features which can be controlled by Feature Policy. |
| 155 static FeatureList& getDefaultFeatureList(); | 155 static FeatureList& getDefaultFeatureList(); |
| 156 | 156 |
| 157 String toString(); | 157 String toString(); |
| 158 | 158 |
| 159 static WebFeaturePolicyFeature getWebFeaturePolicyFeature( | |
|
iclelland
2017/02/08 15:06:24
Can you add a comment for this?
lunalu1
2017/02/08 19:50:30
Done.
| |
| 160 const String& feature); | |
| 161 | |
| 159 private: | 162 private: |
| 160 friend class FeaturePolicyTest; | 163 friend class FeaturePolicyTest; |
| 161 friend class FeaturePolicyInFrameTest; | 164 friend class FeaturePolicyInFrameTest; |
| 162 | 165 |
| 163 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features); | 166 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features); |
| 164 | 167 |
| 165 static std::unique_ptr<FeaturePolicy> createFromParentPolicy( | 168 static std::unique_ptr<FeaturePolicy> createFromParentPolicy( |
| 166 const FeaturePolicy* parent, | 169 const FeaturePolicy* parent, |
| 167 RefPtr<SecurityOrigin>, | 170 RefPtr<SecurityOrigin>, |
| 168 FeatureList& features); | 171 FeatureList& features); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 198 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature; | 201 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature; |
| 199 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript; | 202 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript; |
| 200 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR; | 203 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR; |
| 201 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia; | 204 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia; |
| 202 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature; | 205 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature; |
| 203 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC; | 206 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC; |
| 204 | 207 |
| 205 } // namespace blink | 208 } // namespace blink |
| 206 | 209 |
| 207 #endif // FeaturePolicy_h | 210 #endif // FeaturePolicy_h |
| OLD | NEW |