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

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

Issue 1678003002: Remove sampling trace events from the binding layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
8 {% if constant.deprecate_as %} 7 {% if constant.deprecate_as %}
9 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); 8 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}});
10 {% endif %} 9 {% endif %}
11 {% if constant.measure_as %} 10 {% if constant.measure_as %}
12 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')}});
13 {% endif %} 12 {% endif %}
14 {% if constant.is_api_experiment_enabled %} 13 {% if constant.is_api_experiment_enabled %}
15 {{check_api_experiment(constant) | indent}} 14 {{check_api_experiment(constant) | indent}}
16 {% endif %} 15 {% endif %}
17 {% if constant.idl_type in ('Double', 'Float') %} 16 {% if constant.idl_type in ('Double', 'Float') %}
18 v8SetReturnValue(info, {{constant.value}}); 17 v8SetReturnValue(info, {{constant.value}});
19 {% elif constant.idl_type == 'String' %} 18 {% elif constant.idl_type == 'String' %}
20 v8SetReturnValueString(info, "{{constant.value}}"); 19 v8SetReturnValueString(info, "{{constant.value}}");
21 {% else %} 20 {% else %}
22 v8SetReturnValueInt(info, {{constant.value}}); 21 v8SetReturnValueInt(info, {{constant.value}});
23 {% endif %} 22 {% endif %}
24 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
25 } 23 }
26 {% endmacro %} 24 {% endmacro %}
27 25
28 26
29 {######################################} 27 {######################################}
30 {% macro install_constants() %} 28 {% macro install_constants() %}
31 {% if constant_configuration_constants %} 29 {% if constant_configuration_constants %}
32 {# Normal constants #} 30 {# Normal constants #}
33 const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = { 31 const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = {
34 {% for constant in constant_configuration_constants %} 32 {% for constant in constant_configuration_constants %}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 {######################################} 64 {######################################}
67 {%- macro constant_configuration(constant) %} 65 {%- macro constant_configuration(constant) %}
68 {% if constant.idl_type in ('Double', 'Float') %} 66 {% if constant.idl_type in ('Double', 'Float') %}
69 {% set value = '0, %s' % constant.value %} 67 {% set value = '0, %s' % constant.value %}
70 {% else %} 68 {% else %}
71 {# 'Short', 'Long' etc. #} 69 {# 'Short', 'Long' etc. #}
72 {% set value = '%s, 0' % constant.value %} 70 {% set value = '%s, 0' % constant.value %}
73 {% endif %} 71 {% endif %}
74 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 72 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
75 {%- endmacro %} 73 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698