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

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

Issue 2304453004: [Bindings] Expose V8 callback functions in generated code (Closed)
Patch Set: Expose call Callback functions in binding scripts Created 4 years, 3 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 {##############################################################################} 1 {##############################################################################}
2 {% macro constant_getter_callback(constant) %} 2 {% macro constant_getter_callback(constant) %}
3 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info) 3 void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v8::Prop ertyCallbackInfo<v8::Value>& info)
4 { 4 {
5 {% if constant.deprecate_as %} 5 {% if constant.deprecate_as %}
6 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); 6 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}});
7 {% endif %} 7 {% endif %}
8 {% if constant.measure_as %} 8 {% if constant.measure_as %}
9 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); 9 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}});
10 {% endif %} 10 {% endif %}
11 {% if constant.idl_type in ('Double', 'Float') %} 11 {% if constant.idl_type in ('Double', 'Float') %}
12 v8SetReturnValue(info, {{constant.value}}); 12 v8SetReturnValue(info, {{constant.value}});
13 {% elif constant.idl_type == 'String' %} 13 {% elif constant.idl_type == 'String' %}
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 {######################################} 59 {######################################}
60 {%- macro constant_configuration(constant) %} 60 {%- macro constant_configuration(constant) %}
61 {% if constant.idl_type in ('Double', 'Float') %} 61 {% if constant.idl_type in ('Double', 'Float') %}
62 {% set value = '0, %s' % constant.value %} 62 {% set value = '0, %s' % constant.value %}
63 {% else %} 63 {% else %}
64 {# 'Short', 'Long' etc. #} 64 {# 'Short', 'Long' etc. #}
65 {% set value = '%s, 0' % constant.value %} 65 {% set value = '%s, 0' % constant.value %}
66 {% endif %} 66 {% endif %}
67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
68 {%- endmacro %} 68 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698