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

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

Issue 2446213002: [Bindings] [Reformat] Reformat template files (Closed)
Patch Set: Rebase (Split out Callbackfunctions) Created 4 years, 1 month 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 void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v8::Prop ertyCallbackInfo<v8::Value>& info) 3 void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v8::Prop ertyCallbackInfo<v8::Value>& info) {
4 { 4 {% if constant.deprecate_as %}
5 {% if constant.deprecate_as %} 5 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExec utionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}});
6 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); 6 {% endif %}
7 {% endif %} 7 {% if constant.measure_as %}
8 {% if constant.measure_as %} 8 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext (info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}});
9 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); 9 {% endif %}
10 {% endif %} 10 {% if constant.idl_type in ('Double', 'Float') %}
11 {% if constant.idl_type in ('Double', 'Float') %} 11 v8SetReturnValue(info, {{constant.value}});
12 v8SetReturnValue(info, {{constant.value}}); 12 {% elif constant.idl_type == 'String' %}
13 {% elif constant.idl_type == 'String' %} 13 v8SetReturnValueString(info, "{{constant.value}}");
14 v8SetReturnValueString(info, "{{constant.value}}"); 14 {% else %}
15 {% else %} 15 v8SetReturnValueInt(info, {{constant.value}});
16 v8SetReturnValueInt(info, {{constant.value}}); 16 {% endif %}
17 {% endif %}
18 } 17 }
19 {% endmacro %} 18 {% endmacro %}
20 19
21 20
22 {######################################} 21 {######################################}
23 {% macro install_constants() %} 22 {% macro install_constants() %}
24 {% if constants | has_constant_configuration %} 23 {% if constants | has_constant_configuration %}
25 {# Normal constants #} 24 {# Normal constants #}
26 const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = { 25 const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = {
27 {% for constant in constants | has_constant_configuration %} 26 {% for constant in constants | has_constant_configuration %}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 {######################################} 58 {######################################}
60 {%- macro constant_configuration(constant) %} 59 {%- macro constant_configuration(constant) %}
61 {% if constant.idl_type in ('Double', 'Float') %} 60 {% if constant.idl_type in ('Double', 'Float') %}
62 {% set value = '0, %s' % constant.value %} 61 {% set value = '0, %s' % constant.value %}
63 {% else %} 62 {% else %}
64 {# 'Short', 'Long' etc. #} 63 {# 'Short', 'Long' etc. #}
65 {% set value = '%s, 0' % constant.value %} 64 {% set value = '%s, 0' % constant.value %}
66 {% endif %} 65 {% endif %}
67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 66 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
68 {%- endmacro %} 67 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698