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

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

Issue 2692753003: [Bindings] Update runtime enabled features from partial interfaces (Closed)
Patch Set: Remove needless classname addition 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 7 '%s::preparePrototypeAndInterfaceObject' % v8_class
8 if has_prepare_prototype_and_interface_object 8 if has_prepare_prototype_and_interface_object
9 else 'nullptr' %} 9 else 'nullptr' %}
10 10
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 {% endfilter %}{# runtime_enabled #} 913 {% endfilter %}{# runtime_enabled #}
914 {% endfilter %}{# secure_context #} 914 {% endfilter %}{# secure_context #}
915 {% endfilter %}{# exposed #} 915 {% endfilter %}{# exposed #}
916 {% endfor %} 916 {% endfor %}
917 {% endmacro %} 917 {% endmacro %}
918 918
919 919
920 {##############################################################################} 920 {##############################################################################}
921 {% block partial_interface %} 921 {% block partial_interface %}
922 {% if has_partial_interface %} 922 {% if has_partial_interface %}
923 {% if needs_runtime_enabled_installer %}
924 InstallRuntimeEnabledFunction {{v8_class}}::install{{v8_class}}RuntimeEnabledFun ction = (InstallRuntimeEnabledFunction)&{{v8_class}}::installRuntimeEnabledFeatu res;
Yuki 2017/02/13 12:15:03 nit: Better avoid casting.
925 {% endif %}
926
923 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins tallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template; 927 InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins tallTemplateFunction)&{{v8_class}}::install{{v8_class}}Template;
924 928
925 void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplate Function, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfac eObjectFunction) { 929 void {{v8_class}}::updateWrapperTypeInfo(
926 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction; 930 InstallTemplateFunction installTemplateFunction,
927 if (preparePrototypeAndInterfaceObjectFunction) 931 InstallRuntimeEnabledFunction installRuntimeEnabledFunction,
928 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = p reparePrototypeAndInterfaceObjectFunction; 932 PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjec tFunction) {
933 ALLOW_UNUSED_LOCAL(installRuntimeEnabledFunction);
934
935 {{v8_class}}::install{{v8_class}}TemplateFunction =
936 installTemplateFunction;
937 {% if needs_runtime_enabled_installer %}
938 CHECK(installRuntimeEnabledFunction);
939 {{v8_class}}::install{{v8_class}}RuntimeEnabledFunction =
940 installRuntimeEnabledFunction;
941 {% endif %}
942 if (preparePrototypeAndInterfaceObjectFunction) {
943 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction =
944 preparePrototypeAndInterfaceObjectFunction;
945 }
929 } 946 }
930 947
931 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 948 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
932 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { 949 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) {
933 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 950 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
934 } 951 }
935 952
936 {% endfor %} 953 {% endfor %}
937 {% endif %} 954 {% endif %}
938 {% endblock %} 955 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698