Chromium Code Reviews| Index: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h |
| diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h |
| index e4f38bb0a5bf71905ec5c110579c17db50bafb27..c223db5eb5a3f8ae755d9dda45a42641532781de 100644 |
| --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h |
| +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h |
| @@ -7,8 +7,10 @@ |
| #include "platform/PlatformExport.h" |
| #include "platform/weborigin/SecurityOrigin.h" |
| +#include "platform/wtf/HashMap.h" |
| #include "platform/wtf/RefPtr.h" |
| #include "platform/wtf/Vector.h" |
| +#include "platform/wtf/text/StringHash.h" |
| #include "platform/wtf/text/WTFString.h" |
| #include "public/platform/WebFeaturePolicy.h" |
| @@ -16,10 +18,10 @@ |
| namespace blink { |
| -// Returns the corresponding WebFeaturePolicyFeature enum given a feature |
| -// string. |
| -PLATFORM_EXPORT WebFeaturePolicyFeature |
| -GetWebFeaturePolicyFeature(const String& feature); |
| +// Returns a map between feature name (string) and WebFeaturePolicyFeature |
| +// (enum). |
| +typedef HashMap<String, WebFeaturePolicyFeature> FeatureNameMap; |
| +PLATFORM_EXPORT const FeatureNameMap& GetDefaultFeatureNameMap(); |
| // Converts a JSON feature policy string into a vector of whitelists, one for |
| // each feature specified. Unrecognized features are filtered out. If |messages| |
| @@ -30,6 +32,12 @@ ParseFeaturePolicy(const String& policy, |
| RefPtr<SecurityOrigin>, |
| Vector<String>* messages); |
| +PLATFORM_EXPORT WebParsedFeaturePolicy |
|
iclelland
2017/04/19 17:23:28
Can you add a comment here that this version with
|
| +ParseFeaturePolicy(const String& policy, |
| + RefPtr<SecurityOrigin>, |
| + Vector<String>* messages, |
| + const FeatureNameMap& feature_names); |
| + |
| // Given a vector of WebFeaturePolicyFeatures and an origin, creates a vector of |
| // whitelists, one for each feature specified. |
| PLATFORM_EXPORT WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures( |