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..69bcca76d087b82fc489786020e7e587492ad368 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h |
| @@ -5,21 +5,40 @@ |
| #ifndef ConditionalFeatures_h |
| #define ConditionalFeatures_h |
| -#include "bindings/core/v8/DOMWrapperWorld.h" |
| #include "core/CoreExport.h" |
| #include "platform/feature_policy/FeaturePolicy.h" |
| +#include "wtf/text/WTFString.h" |
| #include <v8.h> |
| namespace blink { |
| -class ScriptState; |
| class LocalFrame; |
| +class ScriptState; |
| +struct WrapperTypeInfo; |
| using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, |
| const ScriptState*, |
| 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,20 @@ 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) |
|
haraken
2017/01/28 02:25:20
Not related to this CL, would you again help me un
chasej
2017/01/30 19:15:56
This method is called in LocalWindowProxy::initial
iclelland
2017/01/30 20:37:39
As I recall, when navigating between documents (no
haraken
2017/01/31 08:19:35
Hmm, I'm a bit confused.
When we navigate from on
iclelland
2017/01/31 15:29:17
The original issue that prompted that code was htt
|
| 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*); |
| + |
| CORE_EXPORT bool isFeatureEnabledInFrame(const FeaturePolicy::Feature&, |
| const LocalFrame*); |