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

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

Issue 2717283002: [Bindings][Refactoring] Move logics of preparePrototypeAndInterfaceObject from .tmpl to .py (Closed)
Patch Set: Created 3 years, 9 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 =
4 unscopables or has_conditional_attributes_on_prototype or
5 methods | conditionally_exposed(is_partial) %}
6 {% set prepare_prototype_and_interface_object_func =
7 '%s::preparePrototypeAndInterfaceObject' % v8_class_or_partial
8 if has_prepare_prototype_and_interface_object
9 else 'nullptr' %}
10
11
12 {##############################################################################} 3 {##############################################################################}
13 {% block partial_interface %} 4 {% block partial_interface %}
14 void {{v8_class_or_partial}}::initialize() { 5 void {{v8_class_or_partial}}::initialize() {
15 // Should be invoked from ModulesInitializer. 6 // Should be invoked from ModulesInitializer.
16 {{v8_class}}::updateWrapperTypeInfo( 7 {{v8_class}}::updateWrapperTypeInfo(
17 &{{v8_class_or_partial}}::install{{v8_class}}Template, 8 &{{v8_class_or_partial}}::install{{v8_class}}Template,
18 {% if needs_runtime_enabled_installer %} 9 {% if needs_runtime_enabled_installer %}
19 &{{v8_class_or_partial}}::installRuntimeEnabledFeatures, 10 &{{v8_class_or_partial}}::installRuntimeEnabledFeatures,
20 {% else %} 11 {% else %}
21 nullptr, 12 nullptr,
22 {% endif %} 13 {% endif %}
23 {{prepare_prototype_and_interface_object_func}}); 14 {{prepare_prototype_and_interface_object_func or 'nullptr'}});
24 {% for method in methods %} 15 {% for method in methods %}
25 {% if method.overloads and method.overloads.has_partial_overloads %} 16 {% if method.overloads and method.overloads.has_partial_overloads %}
26 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterf ace(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method); 17 {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInterf ace(&{{cpp_class_or_partial}}V8Internal::{{method.name}}Method);
27 {% endif %} 18 {% endif %}
28 {% endfor %} 19 {% endfor %}
29 } 20 }
30 21
31 {% endblock %} 22 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698