Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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( cpp_value='original', isolate='info.GetIsolate()', creation_context='v8::Handle< v8::Object>()')}}; | |
|
Nils Barth (inactive)
2014/04/23 01:12:02
Could you put the function call in the Python code
Devlin
2014/04/23 01:31:43
Yes. But I didn't because there's so much context
Nils Barth (inactive)
2014/04/23 03:04:42
That's a good point, but as a rule we're putting a
| |
| 322 {% else %} | |
| 323 {# If we don't log the old value, we send an empty value in its place. # } | |
|
Nils Barth (inactive)
2014/04/23 01:12:02
Would it be clearer to overload logSetter so we ca
Devlin
2014/04/23 01:31:43
Sure. (Originally didn't because chrome doesn't l
Nils Barth (inactive)
2014/04/23 03:04:42
...at least for the next day or two ;)
| |
| 324 v8::Handle<v8::Value> originalValue; | |
| 325 {% endif %} | |
| 326 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value, originalValue); | |
| 316 } | 327 } |
| 317 {% endif %} | 328 {% endif %} |
| 318 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} | 329 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} |
| 319 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 330 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 320 {% endif %} | 331 {% endif %} |
| 321 {% if attribute.has_custom_setter %} | 332 {% if attribute.has_custom_setter %} |
| 322 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); | 333 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); |
| 323 {% else %} | 334 {% else %} |
| 324 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); | 335 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); |
| 325 {% endif %} | 336 {% endif %} |
| 326 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 327 } | 338 } |
| 328 {% endfilter %} | 339 {% endfilter %} |
| 329 {% endmacro %} | 340 {% endmacro %} |
| OLD | NEW |