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

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

Issue 31503002: IDL compiler: [ActivityLogging] for setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 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
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro attribute_getter(attribute, world_suffix) %} 2 {% macro attribute_getter(attribute, world_suffix) %}
3 {% filter conditional(attribute.conditional_string) %} 3 {% filter conditional(attribute.conditional_string) %}
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri ng> name, const v8::PropertyCallbackInfo<v8::Value>& info) 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri ng> name, const v8::PropertyCallbackInfo<v8::Value>& info)
5 { 5 {
6 {% if attribute.is_unforgeable %} 6 {% if attribute.is_unforgeable %}
7 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{ v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); 7 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{ v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
8 if (holder.IsEmpty()) 8 if (holder.IsEmpty())
9 return; 9 return;
10 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder); 10 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 {% filter conditional(attribute.conditional_string) %} 79 {% filter conditional(attribute.conditional_string) %}
80 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(v8::Local< v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 80 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(v8::Local< v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
81 { 81 {
82 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 82 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
83 {% if attribute.deprecate_as %} 83 {% if attribute.deprecate_as %}
84 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{attribu te.deprecate_as}}); 84 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{attribu te.deprecate_as}});
85 {% endif %} 85 {% endif %}
86 {% if attribute.measure_as %} 86 {% if attribute.measure_as %}
87 UseCounter::count(activeDOMWindow(), UseCounter::{{attribute.measure_as}}); 87 UseCounter::count(activeDOMWindow(), UseCounter::{{attribute.measure_as}});
88 {% endif %} 88 {% endif %}
89 {% if world_suffix in attribute.activity_logging_getter %} 89 {% if world_suffix in attribute.activity_logging_world_list_for_getter %}
90 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 90 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
91 if (contextData && contextData->activityLogger()) 91 if (contextData && contextData->activityLogger())
92 contextData->activityLogger()->log("{{interface_name}}.{{attribute.name} }", 0, 0, "Getter"); 92 contextData->activityLogger()->log("{{interface_name}}.{{attribute.name} }", 0, 0, "Getter");
93 {% endif %} 93 {% endif %}
94 {% if attribute.has_custom_getter %} 94 {% if attribute.has_custom_getter %}
95 {{v8_class_name}}::{{attribute.name}}AttributeGetterCustom(name, info); 95 {{v8_class_name}}::{{attribute.name}}AttributeGetterCustom(name, info);
96 {% else %} 96 {% else %}
97 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffi x}}(name, info); 97 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffi x}}(name, info);
98 {% endif %} 98 {% endif %}
99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 {##############################################################################} 132 {##############################################################################}
133 {% macro attribute_setter_callback(attribute, world_suffix) %} 133 {% macro attribute_setter_callback(attribute, world_suffix) %}
134 {% filter conditional(attribute.conditional_string) %} 134 {% filter conditional(attribute.conditional_string) %}
135 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(v8::Local< v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info) 135 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(v8::Local< v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info)
136 { 136 {
137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
138 {% if attribute.deprecate_as %} 138 {% if attribute.deprecate_as %}
139 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{attribu te.deprecate_as}}); 139 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{attribu te.deprecate_as}});
140 {% endif %} 140 {% endif %}
141 {% if world_suffix in attribute.activity_logging_world_list_for_setter %}
142 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
143 if (contextData && contextData->activityLogger()) {
144 v8::Handle<v8::Value> loggerArg[] = { jsValue };
145 contextData->activityLogger()->log("{{interface_name}}.{{attribute.name} }", 1, &loggerArg[0], "Setter");
146 }
147 {% endif %}
141 {% if attribute.has_custom_setter %} 148 {% if attribute.has_custom_setter %}
142 {{v8_class_name}}::{{attribute.name}}AttributeSetterCustom(name, jsValue, in fo); 149 {{v8_class_name}}::{{attribute.name}}AttributeSetterCustom(name, jsValue, in fo);
143 {% else %} 150 {% else %}
144 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi x}}(name, jsValue, info); 151 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi x}}(name, jsValue, info);
145 {% endif %} 152 {% endif %}
146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
147 } 154 }
148 {% endfilter %} 155 {% endfilter %}
149 {% endmacro %} 156 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_utilities.py ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698