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

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

Issue 1861433002: Make [OriginTrialEnabled] and [RuntimeEnabled] mutually exclusive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@586594-separate-tests
Patch Set: Correct IDL for Web Bluetooth Created 4 years, 8 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 {% from 'utilities.cpp' import check_origin_trial %} 1 {% from 'utilities.cpp' import check_origin_trial %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro constant_getter_callback(constant) %} 4 {% macro constant_getter_callback(constant) %}
5 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info) 5 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info)
6 { 6 {
7 {% if constant.deprecate_as %} 7 {% if constant.deprecate_as %}
8 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); 8 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}});
9 {% endif %} 9 {% endif %}
10 {% if constant.measure_as %} 10 {% if constant.measure_as %}
11 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); 11 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}});
12 {% endif %} 12 {% endif %}
13 {% if constant.is_origin_trial_enabled %} 13 {% if constant.origin_trial_enabled_function %}
14 {{check_origin_trial(constant) | indent}} 14 {{check_origin_trial(constant) | indent}}
15 {% endif %} 15 {% endif %}
16 {% if constant.idl_type in ('Double', 'Float') %} 16 {% if constant.idl_type in ('Double', 'Float') %}
17 v8SetReturnValue(info, {{constant.value}}); 17 v8SetReturnValue(info, {{constant.value}});
18 {% elif constant.idl_type == 'String' %} 18 {% elif constant.idl_type == 'String' %}
19 v8SetReturnValueString(info, "{{constant.value}}"); 19 v8SetReturnValueString(info, "{{constant.value}}");
20 {% else %} 20 {% else %}
21 v8SetReturnValueInt(info, {{constant.value}}); 21 v8SetReturnValueInt(info, {{constant.value}});
22 {% endif %} 22 {% endif %}
23 } 23 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 {######################################} 64 {######################################}
65 {%- macro constant_configuration(constant) %} 65 {%- macro constant_configuration(constant) %}
66 {% if constant.idl_type in ('Double', 'Float') %} 66 {% if constant.idl_type in ('Double', 'Float') %}
67 {% set value = '0, %s' % constant.value %} 67 {% set value = '0, %s' % constant.value %}
68 {% else %} 68 {% else %}
69 {# 'Short', 'Long' etc. #} 69 {# 'Short', 'Long' etc. #}
70 {% set value = '%s, 0' % constant.value %} 70 {% set value = '%s, 0' % constant.value %}
71 {% endif %} 71 {% endif %}
72 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 72 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
73 {%- endmacro %} 73 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698