| OLD | NEW |
| 1 {% extends 'interface_base.cpp.tmpl' %} | 1 {% extends 'interface_base.cpp.tmpl' %} |
| 2 | 2 |
| 3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
| 4 unscopables 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.tmpl' import install_unscopables with context %} | 14 {% from 'interface.cpp.tmpl' import install_unscopables with context %} |
| 15 {% from 'interface.cpp.tmpl' import install_conditionally_enabled_attributes_on_
prototype with context %} | 15 {% from 'interface.cpp.tmpl' import install_conditionally_enabled_attributes_on_
prototype with context %} |
| 16 {% from 'methods.cpp.tmpl' import install_conditionally_enabled_methods | 16 {% from 'methods.cpp.tmpl' import install_conditionally_enabled_methods with con
text %} |
| 17 with context %} | |
| 18 {% if has_prepare_prototype_and_interface_object %} | 17 {% 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) | 18 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 { | |
| 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> | 19 #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); | 20 {{v8_class}}::preparePrototypeAndInterfaceObject(context, world, prototypeObje
ct, interfaceObject, interfaceTemplate); |
| 23 v8::Isolate* isolate = context->GetIsolate(); | 21 v8::Isolate* isolate = context->GetIsolate(); |
| 24 {% if unscopables %} | 22 {% if unscopables %} |
| 25 {{install_unscopables() | indent}} | 23 {{install_unscopables() | indent(2)}} |
| 26 {% endif %} | 24 {% endif %} |
| 27 {% if has_conditional_attributes_on_prototype %} | 25 {% if has_conditional_attributes_on_prototype %} |
| 28 {{install_conditionally_enabled_attributes_on_prototype() | indent}} | 26 {{install_conditionally_enabled_attributes_on_prototype() | indent(2)}} |
| 29 {% endif %} | 27 {% endif %} |
| 30 {% if methods | conditionally_exposed(is_partial) %} | 28 {% if methods | conditionally_exposed(is_partial) %} |
| 31 {{install_conditionally_enabled_methods() | indent}} | 29 {{install_conditionally_enabled_methods() | indent(2)}} |
| 32 {% endif %} | 30 {% endif %} |
| 33 } | 31 } |
| 34 {% endif %} | 32 {% endif %} |
| 35 | 33 |
| 36 {% endblock %} | 34 {% endblock %} |
| 37 | 35 |
| 38 | 36 |
| 39 {##############################################################################} | 37 {##############################################################################} |
| 40 {% block partial_interface %} | 38 {% block partial_interface %} |
| 41 void {{v8_class_or_partial}}::initialize() | 39 void {{v8_class_or_partial}}::initialize() { |
| 42 { | 40 // Should be invoked from ModulesInitializer. |
| 43 // Should be invoked from ModulesInitializer. | 41 {{v8_class}}::updateWrapperTypeInfo( |
| 44 {{v8_class}}::updateWrapperTypeInfo( | 42 &{{v8_class_or_partial}}::install{{v8_class}}Template, |
| 45 &{{v8_class_or_partial}}::install{{v8_class}}Template, | 43 {{prepare_prototype_and_interface_object_func}}); |
| 46 {{prepare_prototype_and_interface_object_func}}); | 44 {% for method in methods %} |
| 47 {% for method in methods %} | 45 {% if method.overloads and method.overloads.has_partial_overloads %} |
| 48 {% if method.overloads and method.overloads.has_partial_overloads %} | 46 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterf
ace(&{{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); | 47 {% endif %} |
| 50 {% endif %} | 48 {% endfor %} |
| 51 {% endfor %} | |
| 52 } | 49 } |
| 53 | 50 |
| 54 {% endblock %} | 51 {% endblock %} |
| OLD | NEW |