OLD | NEW |
1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
2 | 2 |
3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
4 unscopeables or has_conditional_attributes_on_prototype or | 4 unscopables or has_conditional_attributes_on_prototype or |
5 methods | conditionally_exposed(is_partial) %} | 5 methods | conditionally_exposed(is_partial) %} |
6 {% set prepare_prototype_and_interface_object_func = | 6 {% set prepare_prototype_and_interface_object_func = |
7 '%s::preparePrototypeAndInterfaceObject' % v8_class_or_partial | 7 '%s::preparePrototypeAndInterfaceObject' % v8_class_or_partial |
8 if has_prepare_prototype_and_interface_object | 8 if has_prepare_prototype_and_interface_object |
9 else 'nullptr' %} | 9 else 'nullptr' %} |
10 | 10 |
11 | 11 |
12 {##############################################################################} | 12 {##############################################################################} |
13 {% block prepare_prototype_and_interface_object %} | 13 {% block prepare_prototype_and_interface_object %} |
14 {% from 'interface.cpp' import install_unscopeables with context %} | 14 {% from 'interface.cpp' import install_unscopables with context %} |
15 {% from 'interface.cpp' import install_conditionally_enabled_attributes_on_proto
type with context %} | 15 {% from 'interface.cpp' import install_conditionally_enabled_attributes_on_proto
type with context %} |
16 {% from 'methods.cpp' import install_conditionally_enabled_methods | 16 {% from 'methods.cpp' import install_conditionally_enabled_methods |
17 with context %} | 17 with context %} |
18 {% if has_prepare_prototype_and_interface_object %} | 18 {% if has_prepare_prototype_and_interface_object %} |
19 void {{v8_class_or_partial}}::preparePrototypeAndInterfaceObject(v8::Local<v8::C
ontext> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeOb
ject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> i
nterfaceTemplate) | 19 void {{v8_class_or_partial}}::preparePrototypeAndInterfaceObject(v8::Local<v8::C
ontext> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeOb
ject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> i
nterfaceTemplate) |
20 { | 20 { |
21 #error No one is currently using a partial interface with context-dependent prop
erties. If you\'re planning to use it, please consult with the binding team: <b
link-reviews-bindings@chromium.org> | 21 #error No one is currently using a partial interface with context-dependent prop
erties. If you\'re planning to use it, please consult with the binding team: <b
link-reviews-bindings@chromium.org> |
22 {{v8_class}}::preparePrototypeAndInterfaceObject(context, world, prototypeOb
ject, interfaceObject, interfaceTemplate); | 22 {{v8_class}}::preparePrototypeAndInterfaceObject(context, world, prototypeOb
ject, interfaceObject, interfaceTemplate); |
23 v8::Isolate* isolate = context->GetIsolate(); | 23 v8::Isolate* isolate = context->GetIsolate(); |
24 {% if unscopeables %} | 24 {% if unscopables %} |
25 {{install_unscopeables() | indent}} | 25 {{install_unscopables() | indent}} |
26 {% endif %} | 26 {% endif %} |
27 {% if has_conditional_attributes_on_prototype %} | 27 {% if has_conditional_attributes_on_prototype %} |
28 {{install_conditionally_enabled_attributes_on_prototype() | indent}} | 28 {{install_conditionally_enabled_attributes_on_prototype() | indent}} |
29 {% endif %} | 29 {% endif %} |
30 {% if methods | conditionally_exposed(is_partial) %} | 30 {% if methods | conditionally_exposed(is_partial) %} |
31 {{install_conditionally_enabled_methods() | indent}} | 31 {{install_conditionally_enabled_methods() | indent}} |
32 {% endif %} | 32 {% endif %} |
33 } | 33 } |
34 {% endif %} | 34 {% endif %} |
35 | 35 |
36 {% endblock %} | 36 {% endblock %} |
37 | 37 |
38 | 38 |
39 {##############################################################################} | 39 {##############################################################################} |
40 {% block partial_interface %} | 40 {% block partial_interface %} |
41 void {{v8_class_or_partial}}::initialize() | 41 void {{v8_class_or_partial}}::initialize() |
42 { | 42 { |
43 // Should be invoked from ModulesInitializer. | 43 // Should be invoked from ModulesInitializer. |
44 {{v8_class}}::updateWrapperTypeInfo( | 44 {{v8_class}}::updateWrapperTypeInfo( |
45 &{{v8_class_or_partial}}::install{{v8_class}}Template, | 45 &{{v8_class_or_partial}}::install{{v8_class}}Template, |
46 {{prepare_prototype_and_interface_object_func}}); | 46 {{prepare_prototype_and_interface_object_func}}); |
47 {% for method in methods %} | 47 {% for method in methods %} |
48 {% if method.overloads and method.overloads.has_partial_overloads %} | 48 {% if method.overloads and method.overloads.has_partial_overloads %} |
49 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInte
rface(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); | 49 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInte
rface(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); |
50 {% endif %} | 50 {% endif %} |
51 {% endfor %} | 51 {% endfor %} |
52 } | 52 } |
53 | 53 |
54 {% endblock %} | 54 {% endblock %} |
OLD | NEW |