OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 ConditionalFeaturesForCore_h | 5 #ifndef ConditionalFeaturesForCore_h |
6 #define ConditionalFeaturesForCore_h | 6 #define ConditionalFeaturesForCore_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/feature_policy/FeaturePolicy.h" | 9 #include "public/platform/WebFeaturePolicy.h" |
10 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class LocalFrame; | 14 class Frame; |
15 class ScriptState; | 15 class ScriptState; |
16 | 16 |
17 // Installs all of the conditionally enabled V8 bindings on the Window object. | 17 // Installs all of the conditionally enabled V8 bindings on the Window object. |
18 // This is called separately from other objects so that attributes and | 18 // This is called separately from other objects so that attributes and |
19 // interfaces which need to be visible on the global object are installed even | 19 // interfaces which need to be visible on the global object are installed even |
20 // when the V8 context is reused (i.e., after navigation) | 20 // when the V8 context is reused (i.e., after navigation) |
21 CORE_EXPORT void installConditionalFeaturesOnWindow(const ScriptState*); | 21 CORE_EXPORT void installConditionalFeaturesOnWindow(const ScriptState*); |
22 | 22 |
23 CORE_EXPORT bool isFeatureEnabledInFrame(const FeaturePolicy::Feature&, | 23 // Tests whether the feature-policy controlled feature is enabled by policy in |
24 const LocalFrame*); | 24 // the given frame. |
25 CORE_EXPORT bool isFeatureEnabledInFrame(WebFeaturePolicyFeature, const Frame*); | |
haraken
2017/03/04 07:36:00
Nit: Another option is to make isFeatureEnabledInF
iclelland
2017/03/06 04:17:40
Thanks, I've been thinking about moving this out o
| |
25 | 26 |
26 CORE_EXPORT void registerInstallConditionalFeaturesForCore(); | 27 CORE_EXPORT void registerInstallConditionalFeaturesForCore(); |
27 | 28 |
28 } // namespace blink | 29 } // namespace blink |
29 | 30 |
30 #endif // ConditionalFeaturesForCore_h | 31 #endif // ConditionalFeaturesForCore_h |
OLD | NEW |