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

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

Issue 1579573002: Count feature usage for the current context instead of the calling one (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_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
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 %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698