OLD | NEW |
1 {% from 'utilities.cpp' import check_api_experiment %} | 1 {% from 'utilities.cpp' import check_api_experiment %} |
2 | 2 |
3 {##############################################################################} | 3 {##############################################################################} |
4 {% macro constant_getter_callback(constant) %} | 4 {% macro constant_getter_callback(constant) %} |
5 {% filter conditional(constant.conditional_string) %} | 5 {% filter conditional(constant.conditional_string) %} |
6 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 6 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
7 { | 7 { |
8 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 8 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
9 {% if constant.deprecate_as %} | 9 {% if constant.deprecate_as %} |
10 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); | 10 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe
cutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); |
11 {% endif %} | 11 {% endif %} |
12 {% if constant.measure_as %} | 12 {% if constant.measure_as %} |
13 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); | 13 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); |
14 {% endif %} | 14 {% endif %} |
15 {% if constant.is_api_experiment_enabled %} | 15 {% if constant.is_api_experiment_enabled %} |
16 {{check_api_experiment(constant) | indent}} | 16 {{check_api_experiment(constant) | indent}} |
17 {% endif %} | 17 {% endif %} |
18 {% if constant.idl_type in ('Double', 'Float') %} | 18 {% if constant.idl_type in ('Double', 'Float') %} |
19 v8SetReturnValue(info, {{constant.value}}); | 19 v8SetReturnValue(info, {{constant.value}}); |
20 {% elif constant.idl_type == 'String' %} | 20 {% elif constant.idl_type == 'String' %} |
21 v8SetReturnValueString(info, "{{constant.value}}"); | 21 v8SetReturnValueString(info, "{{constant.value}}"); |
22 {% else %} | 22 {% else %} |
23 v8SetReturnValueInt(info, {{constant.value}}); | 23 v8SetReturnValueInt(info, {{constant.value}}); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 {######################################} | 68 {######################################} |
69 {%- macro constant_configuration(constant) %} | 69 {%- macro constant_configuration(constant) %} |
70 {% if constant.idl_type in ('Double', 'Float') %} | 70 {% if constant.idl_type in ('Double', 'Float') %} |
71 {% set value = '0, %s' % constant.value %} | 71 {% set value = '0, %s' % constant.value %} |
72 {% else %} | 72 {% else %} |
73 {# 'Short', 'Long' etc. #} | 73 {# 'Short', 'Long' etc. #} |
74 {% set value = '%s, 0' % constant.value %} | 74 {% set value = '%s, 0' % constant.value %} |
75 {% endif %} | 75 {% endif %} |
76 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_
type}}} | 76 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_
type}}} |
77 {%- endmacro %} | 77 {%- endmacro %} |
OLD | NEW |