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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 {%- endif %}) | 158 {%- endif %}) |
159 { | 159 { |
160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
161 {% if attribute.deprecate_as %} | 161 {% if attribute.deprecate_as %} |
162 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{attribute.deprecate_as}}); | 162 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{attribute.deprecate_as}}); |
163 {% endif %} | 163 {% endif %} |
164 {% if attribute.measure_as %} | 164 {% if attribute.measure_as %} |
165 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
attribute.measure_as}}); | 165 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
attribute.measure_as}}); |
166 {% endif %} | 166 {% endif %} |
167 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} | 167 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} |
168 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 168 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
| 169 V8PerContextData* contextData = scriptState->perContextData(); |
| 170 {% if attribute.activity_logging_world_check %} |
| 171 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
| 172 {% else %} |
169 if (contextData && contextData->activityLogger()) | 173 if (contextData && contextData->activityLogger()) |
| 174 {% endif %} |
170 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); | 175 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); |
171 {% endif %} | 176 {% endif %} |
172 {% if attribute.has_custom_getter %} | 177 {% if attribute.has_custom_getter %} |
173 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); | 178 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); |
174 {% else %} | 179 {% else %} |
175 {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(i
nfo); | 180 {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(i
nfo); |
176 {% endif %} | 181 {% endif %} |
177 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
178 } | 183 } |
179 {% endfilter %} | 184 {% endfilter %} |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 v8::Local<v8::Value> v8Value = info[0]; | 311 v8::Local<v8::Value> v8Value = info[0]; |
307 {% endif %} | 312 {% endif %} |
308 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 313 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
309 {% if attribute.deprecate_as %} | 314 {% if attribute.deprecate_as %} |
310 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{attribute.deprecate_as}}); | 315 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{attribute.deprecate_as}}); |
311 {% endif %} | 316 {% endif %} |
312 {% if attribute.measure_as %} | 317 {% if attribute.measure_as %} |
313 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
attribute.measure_as}}); | 318 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
attribute.measure_as}}); |
314 {% endif %} | 319 {% endif %} |
315 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} | 320 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} |
316 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 321 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
| 322 V8PerContextData* contextData = scriptState->perContextData(); |
| 323 {% if attribute.activity_logging_world_check %} |
| 324 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) { |
| 325 {% else %} |
317 if (contextData && contextData->activityLogger()) { | 326 if (contextData && contextData->activityLogger()) { |
| 327 {% endif %} |
318 {% if attribute.activity_logging_include_old_value_for_setter %} | 328 {% if attribute.activity_logging_include_old_value_for_setter %} |
319 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); | 329 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); |
320 {% if attribute.cpp_value_original %} | 330 {% if attribute.cpp_value_original %} |
321 {{attribute.cpp_type}} original = {{attribute.cpp_value_original}}; | 331 {{attribute.cpp_type}} original = {{attribute.cpp_value_original}}; |
322 {% else %} | 332 {% else %} |
323 {{attribute.cpp_type}} original = {{attribute.cpp_value}}; | 333 {{attribute.cpp_type}} original = {{attribute.cpp_value}}; |
324 {% endif %} | 334 {% endif %} |
325 v8::Handle<v8::Value> originalValue = {{attribute.cpp_value_to_v8_value}
}; | 335 v8::Handle<v8::Value> originalValue = {{attribute.cpp_value_to_v8_value}
}; |
326 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value, originalValue); | 336 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value, originalValue); |
327 {% else %} | 337 {% else %} |
328 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); | 338 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); |
329 {% endif %} | 339 {% endif %} |
330 } | 340 } |
331 {% endif %} | 341 {% endif %} |
332 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} | 342 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} |
333 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 343 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
334 {% endif %} | 344 {% endif %} |
335 {% if attribute.has_custom_setter %} | 345 {% if attribute.has_custom_setter %} |
336 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); | 346 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); |
337 {% else %} | 347 {% else %} |
338 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v
8Value, info); | 348 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v
8Value, info); |
339 {% endif %} | 349 {% endif %} |
340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 350 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
341 } | 351 } |
342 {% endfilter %} | 352 {% endfilter %} |
343 {% endmacro %} | 353 {% endmacro %} |
OLD | NEW |