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 // This file has been moved to platform/bindings/ConditionalFeatures.h. |
6 #define ConditionalFeatures_h | 6 // TODO(adithyas): Remove this file. |
7 | 7 #include "platform/bindings/ConditionalFeatures.h" |
8 #include "core/CoreExport.h" | |
9 #include "platform/wtf/text/WTFString.h" | |
10 #include "v8/include/v8.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class ScriptState; | |
15 struct WrapperTypeInfo; | |
16 | |
17 using InstallConditionalFeaturesFunction = void (*)(const WrapperTypeInfo*, | |
18 const ScriptState*, | |
19 v8::Local<v8::Object>, | |
20 v8::Local<v8::Function>); | |
21 | |
22 using InstallPendingConditionalFeatureFunction = void (*)(const String&, | |
23 const ScriptState*); | |
24 | |
25 // Sets the function to be called by |installConditionalFeatures|. The function | |
26 // is initially set to the private |installConditionalFeaturesDefault| function, | |
27 // but can be overridden by this function. A pointer to the previously set | |
28 // function is returned, so that functions can be chained. | |
29 CORE_EXPORT InstallConditionalFeaturesFunction | |
30 SetInstallConditionalFeaturesFunction(InstallConditionalFeaturesFunction); | |
31 | |
32 // Sets the function to be called by |installPendingConditionalFeature|. This | |
33 // is initially set to the private |installPendingConditionalFeatureDefault| | |
34 // function, but can be overridden by this function. A pointer to the previously | |
35 // set function is returned, so that functions can be chained. | |
36 CORE_EXPORT InstallPendingConditionalFeatureFunction | |
37 SetInstallPendingConditionalFeatureFunction( | |
38 InstallPendingConditionalFeatureFunction); | |
39 | |
40 // Installs all of the conditionally enabled V8 bindings for the given type, in | |
41 // a specific context. This is called in V8PerContextData, after the constructor | |
42 // and prototype for the type have been created. It indirectly calls the | |
43 // function set by |setInstallConditionalFeaturesFunction|. | |
44 CORE_EXPORT void InstallConditionalFeatures(const WrapperTypeInfo*, | |
45 const ScriptState*, | |
46 v8::Local<v8::Object>, | |
47 v8::Local<v8::Function>); | |
48 | |
49 // Installs all of the conditionally enabled V8 bindings for a feature, if | |
50 // needed. This is called to install a newly-enabled feature on any existing | |
51 // objects. If the target object hasn't been created, nothing is installed. The | |
52 // enabled feature will be instead be installed when the object is created | |
53 // (avoids forcing the creation of objects prematurely). | |
54 CORE_EXPORT void InstallPendingConditionalFeature(const String&, | |
55 const ScriptState*); | |
56 | |
57 } // namespace blink | |
58 | |
59 #endif // ConditionalFeatures_h | |
OLD | NEW |