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

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

Issue 656693002: Don't count UseCounters in private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro constant_getter_callback(constant) %} 2 {% macro constant_getter_callback(constant) %}
3 {% filter conditional(constant.conditional_string) %} 3 {% filter conditional(constant.conditional_string) %}
4 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
5 { 5 {
6 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 6 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
7 {% if constant.deprecate_as %} 7 {% if constant.deprecate_as %}
8 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{constant.deprecate_as}}); 8 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe cutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}});
9 {% endif %} 9 {% endif %}
10 {% if constant.measure_as %} 10 {% if constant.measure_as %}
11 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ constant.measure_as}}); 11 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::{{constant.measure_as}});
12 {% endif %} 12 {% endif %}
13 {% if constant.idl_type in ('Double', 'Float') %} 13 {% if constant.idl_type in ('Double', 'Float') %}
14 v8SetReturnValue(info, {{constant.value}}); 14 v8SetReturnValue(info, {{constant.value}});
15 {% elif constant.idl_type == 'String' %} 15 {% elif constant.idl_type == 'String' %}
16 v8SetReturnValueString(info, "{{constant.value}}"); 16 v8SetReturnValueString(info, "{{constant.value}}");
17 {% else %} 17 {% else %}
18 v8SetReturnValueInt(info, {{constant.value}}); 18 v8SetReturnValueInt(info, {{constant.value}});
19 {% endif %} 19 {% endif %}
20 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 20 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
21 } 21 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 {% if constant.idl_type in ('Double', 'Float') %} 62 {% if constant.idl_type in ('Double', 'Float') %}
63 {% set value = '0, %s, 0' % constant.value %} 63 {% set value = '0, %s, 0' % constant.value %}
64 {% elif constant.idl_type == 'String' %} 64 {% elif constant.idl_type == 'String' %}
65 {% set value = '0, 0, "%s"' % constant.value %} 65 {% set value = '0, 0, "%s"' % constant.value %}
66 {% else %} 66 {% else %}
67 {# 'Short', 'Long' etc. #} 67 {# 'Short', 'Long' etc. #}
68 {% set value = '%s, 0, 0' % constant.value %} 68 {% set value = '%s, 0, 0' % constant.value %}
69 {% endif %} 69 {% endif %}
70 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}} 70 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_ type}}}
71 {%- endmacro %} 71 {%- endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698