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

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

Issue 213783002: Pass current value of attributes to WebDOMActivityLogger Setter logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Nils's Created 6 years, 8 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 {##############################################################################} 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}}( 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(
5 {%- if attribute.is_expose_js_accessors %} 5 {%- if attribute.is_expose_js_accessors %}
6 const v8::FunctionCallbackInfo<v8::Value>& info 6 const v8::FunctionCallbackInfo<v8::Value>& info
7 {%- else %} 7 {%- else %}
8 const v8::PropertyCallbackInfo<v8::Value>& info 8 const v8::PropertyCallbackInfo<v8::Value>& info
9 {%- endif %}) 9 {%- endif %})
10 { 10 {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
165 {% if attribute.deprecate_as %} 165 {% if attribute.deprecate_as %}
166 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{attribute.deprecate_as}}); 166 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{attribute.deprecate_as}});
167 {% endif %} 167 {% endif %}
168 {% if attribute.measure_as %} 168 {% if attribute.measure_as %}
169 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ attribute.measure_as}}); 169 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ attribute.measure_as}});
170 {% endif %} 170 {% endif %}
171 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} 171 {% if world_suffix in attribute.activity_logging_world_list_for_getter %}
172 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 172 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
173 if (contextData && contextData->activityLogger()) 173 if (contextData && contextData->activityLogger())
174 contextData->activityLogger()->log("{{interface_name}}.{{attribute.name} }", 0, 0, "Getter"); 174 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute .name}}");
175 {% endif %} 175 {% endif %}
176 {% if attribute.has_custom_getter %} 176 {% if attribute.has_custom_getter %}
177 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); 177 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info);
178 {% else %} 178 {% else %}
179 {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(i nfo); 179 {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(i nfo);
180 {% endif %} 180 {% endif %}
181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
182 } 182 }
183 {% endfilter %} 183 {% endfilter %}
184 {% endmacro %} 184 {% endmacro %}
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 304 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
305 {% if attribute.deprecate_as %} 305 {% if attribute.deprecate_as %}
306 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{attribute.deprecate_as}}); 306 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::{{attribute.deprecate_as}});
307 {% endif %} 307 {% endif %}
308 {% if attribute.measure_as %} 308 {% if attribute.measure_as %}
309 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ attribute.measure_as}}); 309 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{ attribute.measure_as}});
310 {% endif %} 310 {% endif %}
311 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} 311 {% if world_suffix in attribute.activity_logging_world_list_for_setter %}
312 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 312 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
313 if (contextData && contextData->activityLogger()) { 313 if (contextData && contextData->activityLogger()) {
314 v8::Handle<v8::Value> loggerArg[] = { v8Value }; 314 {% if attribute.activity_logging_include_old_value_for_setter %}
315 contextData->activityLogger()->log("{{interface_name}}.{{attribute.name} }", 1, &loggerArg[0], "Setter"); 315 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder());
316 {% if attribute.cpp_value_original %}
317 {{attribute.cpp_type}} original = {{attribute.cpp_value_original}};
318 {% else %}
319 {{attribute.cpp_type}} original = {{attribute.cpp_value}};
320 {% endif %}
321 v8::Handle<v8::Value> originalValue = {{attribute.cpp_value_to_v8_value} };
322 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value, originalValue);
323 {% else %}
324 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value);
325 {% endif %}
316 } 326 }
317 {% endif %} 327 {% endif %}
318 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} 328 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %}
319 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 329 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
320 {% endif %} 330 {% endif %}
321 {% if attribute.has_custom_setter %} 331 {% if attribute.has_custom_setter %}
322 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 332 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
323 {% else %} 333 {% else %}
324 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); 334 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info);
325 {% endif %} 335 {% endif %}
326 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 336 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
327 } 337 }
328 {% endfilter %} 338 {% endfilter %}
329 {% endmacro %} 339 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698