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 ConditionalFeatures_h | 5 #ifndef ConditionalFeatures_h |
6 #define ConditionalFeatures_h | 6 #define ConditionalFeatures_h |
7 | 7 |
| 8 #include <v8.h> |
8 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
9 #include "platform/feature_policy/FeaturePolicy.h" | 10 #include "public/platform/WebFeaturePolicy.h" |
10 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
11 #include <v8.h> | |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class LocalFrame; | 15 class Frame; |
16 class ScriptState; | 16 class ScriptState; |
17 struct WrapperTypeInfo; | 17 struct WrapperTypeInfo; |
18 | 18 |
19 using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, | 19 using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, |
20 const ScriptState*, | 20 const ScriptState*, |
21 v8::Local<v8::Object>, | 21 v8::Local<v8::Object>, |
22 v8::Local<v8::Function>); | 22 v8::Local<v8::Function>); |
23 | 23 |
24 using InstallPendingConditionalFeatureFunction = void (*)(const String&, | 24 using InstallPendingConditionalFeatureFunction = void (*)(const String&, |
25 const ScriptState*); | 25 const ScriptState*); |
(...skipping 29 matching lines...) Expand all Loading... |
55 CORE_EXPORT void installConditionalFeaturesOnWindow(const ScriptState*); | 55 CORE_EXPORT void installConditionalFeaturesOnWindow(const ScriptState*); |
56 | 56 |
57 // Installs all of the conditionally enabled V8 bindings for a feature, if | 57 // Installs all of the conditionally enabled V8 bindings for a feature, if |
58 // needed. This is called to install a newly-enabled feature on any existing | 58 // needed. This is called to install a newly-enabled feature on any existing |
59 // objects. If the target object hasn't been created, nothing is installed. The | 59 // objects. If the target object hasn't been created, nothing is installed. The |
60 // enabled feature will be instead be installed when the object is created | 60 // enabled feature will be instead be installed when the object is created |
61 // (avoids forcing the creation of objects prematurely). | 61 // (avoids forcing the creation of objects prematurely). |
62 CORE_EXPORT void installPendingConditionalFeature(const String&, | 62 CORE_EXPORT void installPendingConditionalFeature(const String&, |
63 const ScriptState*); | 63 const ScriptState*); |
64 | 64 |
65 CORE_EXPORT bool isFeatureEnabledInFrame(const FeaturePolicy::Feature&, | 65 // Tests whether the feature-policy controlled feature is enabled by policy in |
66 const LocalFrame*); | 66 // the given frame. |
| 67 CORE_EXPORT bool isFeatureEnabledInFrame(WebFeaturePolicyFeature, const Frame*); |
67 | 68 |
68 } // namespace blink | 69 } // namespace blink |
69 | 70 |
70 #endif // ConditionalFeatures_h | 71 #endif // ConditionalFeatures_h |
OLD | NEW |