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

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

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Fix multiple definition of signature; addressing nits Created 4 years, 6 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 %}
2
3 {##############################################################################} 1 {##############################################################################}
4 {% macro constant_getter_callback(constant) %} 2 {% macro constant_getter_callback(constant) %}
5 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info) 3 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info)
6 { 4 {
7 {% if constant.deprecate_as %} 5 {% if constant.deprecate_as %}
8 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}});
9 {% endif %} 7 {% endif %}
10 {% if constant.measure_as %} 8 {% if constant.measure_as %}
11 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')}});
12 {% endif %} 10 {% endif %}
13 {% if constant.origin_trial_enabled_function %}
14 {{check_origin_trial(constant) | indent}}
15 {% endif %}
16 {% if constant.idl_type in ('Double', 'Float') %} 11 {% if constant.idl_type in ('Double', 'Float') %}
17 v8SetReturnValue(info, {{constant.value}}); 12 v8SetReturnValue(info, {{constant.value}});
18 {% elif constant.idl_type == 'String' %} 13 {% elif constant.idl_type == 'String' %}
19 v8SetReturnValueString(info, "{{constant.value}}"); 14 v8SetReturnValueString(info, "{{constant.value}}");
20 {% else %} 15 {% else %}
21 v8SetReturnValueInt(info, {{constant.value}}); 16 v8SetReturnValueInt(info, {{constant.value}});
22 {% endif %} 17 {% endif %}
23 } 18 }
24 {% endmacro %} 19 {% endmacro %}
25 20
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 {######################################} 59 {######################################}
65 {%- macro constant_configuration(constant) %} 60 {%- macro constant_configuration(constant) %}
66 {% if constant.idl_type in ('Double', 'Float') %} 61 {% if constant.idl_type in ('Double', 'Float') %}
67 {% set value = '0, %s' % constant.value %} 62 {% set value = '0, %s' % constant.value %}
68 {% else %} 63 {% else %}
69 {# 'Short', 'Long' etc. #} 64 {# 'Short', 'Long' etc. #}
70 {% set value = '%s, 0' % constant.value %} 65 {% set value = '%s, 0' % constant.value %}
71 {% endif %} 66 {% endif %}
72 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
73 {%- endmacro %} 68 {%- endmacro %}
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/attributes.cpp ('k') | third_party/WebKit/Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698