Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h b/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| index 0c9a6040f5926955d921af4e7dd5f5d96e57caba..f2b4b0c1f37ba015d65cf5f7539fb36d9cfd5e63 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| @@ -8,6 +8,7 @@ |
| #include "bindings/core/v8/DOMWrapperWorld.h" |
| #include "core/CoreExport.h" |
| #include "platform/feature_policy/FeaturePolicy.h" |
| +#include "wtf/HashSet.h" |
|
iclelland
2017/01/26 20:14:11
Unneeded here?
chasej
2017/01/27 17:22:36
Yes, removed.
|
| #include <v8.h> |
| namespace blink { |
| @@ -20,6 +21,24 @@ using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, |
| v8::Local<v8::Object>, |
| v8::Local<v8::Function>); |
| +using InstallPendingConditionalFeatureFunction = void (*)(const String&, |
| + const ScriptState*); |
| + |
| +// Sets the function to be called by |installConditionalFeatures|. The function |
| +// is initially set to the private |installConditionalFeaturesCore| function, |
| +// but can be overridden by this function. A pointer to the previously set |
| +// function is returned, so that functions can be chained. |
| +CORE_EXPORT InstallConditionalFeaturesFunction |
| + setInstallConditionalFeaturesFunction(InstallConditionalFeaturesFunction); |
| + |
| +// Sets the function to be called by |installPendingConditionalFeature|. This |
| +// Initially set to the private |installPendingConditionalFeatureCore| function, |
| +// but can be overridden by this function. A pointer to the previously set |
| +// function is returned, so that functions can be chained. |
| +CORE_EXPORT InstallPendingConditionalFeatureFunction |
| + setInstallPendingConditionalFeatureFunction( |
| + InstallPendingConditionalFeatureFunction); |
| + |
| // Installs all of the conditionally enabled V8 bindings for the given type, in |
| // a specific context. This is called in V8PerContextData, after the constructor |
| // and prototype for the type have been created. It indirectly calls the |
| @@ -29,19 +48,30 @@ CORE_EXPORT void installConditionalFeatures(const WrapperTypeInfo*, |
| v8::Local<v8::Object>, |
| v8::Local<v8::Function>); |
| -// Sets the function to be called by |installConditionalFeatures|. The function |
| -// is initially set to the private |installConditionalFeaturesCore| function, |
| -// but can be overridden by this function. A pointer to the previously set |
| -// function is returned, so that functions can be chained. |
| -CORE_EXPORT InstallConditionalFeaturesFunction |
| - setInstallConditionalFeaturesFunction(InstallConditionalFeaturesFunction); |
| - |
| // Installs all of the conditionally enabled V8 bindings on the Window object. |
| // This is called separately from other objects so that attributes and |
| // interfaces which need to be visible on the global object are installed even |
| // when the V8 context is reused (i.e., after navigation) |
| CORE_EXPORT void installPendingConditionalFeaturesOnWindow(const ScriptState*); |
| +// Installs all of the conditionally enabled V8 bindings for a feature, if |
| +// needed. This is called to install a newly-enabled feature on any existing |
| +// objects. If the target object hasn't been created, nothing is installed. The |
| +// enabled feature will be instead be installed when the object is created |
| +// (avoids forcing the creation of objects prematurely). |
| +CORE_EXPORT void installPendingConditionalFeature(const String&, |
| + const ScriptState*); |
| + |
| +// Gets the constructor and prototype for a type, if they have already been |
| +// created. Returns true if they exist, and sets the existing values in |
| +// |prototypeObject| and |interfaceObject|. Otherwise, returns false, and the |
| +// values are set to empty objects (non-null). |
| +CORE_EXPORT bool getExistingConstructorAndPrototypeForType( |
|
iclelland
2017/01/26 20:14:11
Should this be in ConditionalFeatures, or is it mo
chasej
2017/01/27 17:22:36
Moved to V8PerContextData, as the method is also c
|
| + const WrapperTypeInfo*, |
| + const ScriptState*, |
| + v8::Local<v8::Object>* prototypeObject, |
| + v8::Local<v8::Function>* interfaceObject); |
| + |
| CORE_EXPORT bool isFeatureEnabledInFrame(const FeaturePolicy::Feature&, |
| const LocalFrame*); |