Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/bindings/templates/partial_interface.cpp.tmpl

Issue 2692343005: [Bindings] Unify a template block 'prepare_prototype_and_interface_object' (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 %}
14 {% from 'interface.cpp.tmpl' import install_unscopables 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 with con text %}
17 {% if has_prepare_prototype_and_interface_object %}
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) {
19 {{v8_class}}::preparePrototypeAndInterfaceObject(context, world, prototypeObje ct, interfaceObject, interfaceTemplate);
20 v8::Isolate* isolate = context->GetIsolate();
21 {% if unscopables %}
22 {{install_unscopables() | indent(2)}}
23 {% endif %}
24 {% if has_conditional_attributes_on_prototype %}
25 {{install_conditionally_enabled_attributes_on_prototype() | indent(2)}}
26 {% endif %}
27 {% if methods | conditionally_exposed(is_partial) %}
28 {{install_conditionally_enabled_methods() | indent(2)}}
29 {% endif %}
30 }
31 {% endif %}
32
33 {% endblock %}
34
35
36 {##############################################################################}
37 {% block partial_interface %} 13 {% block partial_interface %}
38 void {{v8_class_or_partial}}::initialize() { 14 void {{v8_class_or_partial}}::initialize() {
39 // Should be invoked from ModulesInitializer. 15 // Should be invoked from ModulesInitializer.
40 {{v8_class}}::updateWrapperTypeInfo( 16 {{v8_class}}::updateWrapperTypeInfo(
41 &{{v8_class_or_partial}}::install{{v8_class}}Template, 17 &{{v8_class_or_partial}}::install{{v8_class}}Template,
42 {% if needs_runtime_enabled_installer %} 18 {% if needs_runtime_enabled_installer %}
43 &{{v8_class_or_partial}}::installRuntimeEnabledFeatures, 19 &{{v8_class_or_partial}}::installRuntimeEnabledFeatures,
44 {% else %} 20 {% else %}
45 nullptr, 21 nullptr,
46 {% endif %} 22 {% endif %}
47 {{prepare_prototype_and_interface_object_func}}); 23 {{prepare_prototype_and_interface_object_func}});
48 {% for method in methods %} 24 {% for method in methods %}
49 {% if method.overloads and method.overloads.has_partial_overloads %} 25 {% if method.overloads and method.overloads.has_partial_overloads %}
50 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterf ace(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); 26 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterf ace(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method);
51 {% endif %} 27 {% endif %}
52 {% endfor %} 28 {% endfor %}
53 } 29 }
54 30
55 {% endblock %} 31 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698