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

Side by Side Diff: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h

Issue 2680083002: Initial Implementation of Iframe Attribute for Feature Policy (Part 1) (Closed)
Patch Set: Moved hash function for WebFeaturePolicyFeature to where the enum is defined for ODR purpose Created 3 years, 10 months 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 // 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
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 // Returns the corresponding WebFeaturePolicyFeature enum given a feature
160 // string.
161 static WebFeaturePolicyFeature getWebFeaturePolicyFeature(
162 const String& feature);
163
159 private: 164 private:
160 friend class FeaturePolicyTest; 165 friend class FeaturePolicyTest;
161 friend class FeaturePolicyInFrameTest; 166 friend class FeaturePolicyInFrameTest;
162 167
163 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features); 168 FeaturePolicy(RefPtr<SecurityOrigin>, FeatureList& features);
164 169
165 static std::unique_ptr<FeaturePolicy> createFromParentPolicy( 170 static std::unique_ptr<FeaturePolicy> createFromParentPolicy(
166 const FeaturePolicy* parent, 171 const FeaturePolicy* parent,
167 RefPtr<SecurityOrigin>, 172 RefPtr<SecurityOrigin>,
168 FeatureList& features); 173 FeatureList& features);
(...skipping 29 matching lines...) Expand all
198 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature; 203 extern const PLATFORM_EXPORT FeaturePolicy::Feature kPushFeature;
199 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript; 204 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncScript;
200 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR; 205 extern const PLATFORM_EXPORT FeaturePolicy::Feature kSyncXHR;
201 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia; 206 extern const PLATFORM_EXPORT FeaturePolicy::Feature kUsermedia;
202 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature; 207 extern const PLATFORM_EXPORT FeaturePolicy::Feature kVibrateFeature;
203 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC; 208 extern const PLATFORM_EXPORT FeaturePolicy::Feature kWebRTC;
204 209
205 } // namespace blink 210 } // namespace blink
206 211
207 #endif // FeaturePolicy_h 212 #endif // FeaturePolicy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698