| 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}}(const v8::Property
CallbackInfo<v8::Value>& info) | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(const v8::Property
CallbackInfo<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 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 {% elif not (attribute.is_static or attribute.is_unforgeable) %} | 22 {% elif not (attribute.is_static or attribute.is_unforgeable) %} |
| 23 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); | 23 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |
| 24 {% endif %} | 24 {% endif %} |
| 25 {% if attribute.is_call_with_execution_context %} | 25 {% if attribute.is_call_with_execution_context %} |
| 26 ExecutionContext* scriptContext = getExecutionContext(); | 26 ExecutionContext* scriptContext = getExecutionContext(); |
| 27 {% endif %} | 27 {% endif %} |
| 28 {# Special cases #} | 28 {# Special cases #} |
| 29 {% if attribute.is_check_security_for_node %} | 29 {% if attribute.is_check_security_for_node %} |
| 30 {# FIXME: consider using a local variable to not call getter twice #} | 30 {# FIXME: consider using a local variable to not call getter twice #} |
| 31 ExceptionState es(info.GetIsolate()); | 31 ExceptionState es(info.Holder(), info.GetIsolate()); |
| 32 if (!BindingSecurity::shouldAllowAccessToNode({{attribute.cpp_value}}, es))
{ | 32 if (!BindingSecurity::shouldAllowAccessToNode({{attribute.cpp_value}}, es))
{ |
| 33 v8SetReturnValueNull(info); | 33 v8SetReturnValueNull(info); |
| 34 es.throwIfNeeded(); | 34 es.throwIfNeeded(); |
| 35 return; | 35 return; |
| 36 } | 36 } |
| 37 {% endif %} | 37 {% endif %} |
| 38 {% if attribute.is_getter_raises_exception %} | 38 {% if attribute.is_getter_raises_exception %} |
| 39 ExceptionState es(info.GetIsolate()); | 39 ExceptionState es(info.Holder(), info.GetIsolate()); |
| 40 {{attribute.cpp_type}} {{attribute.cpp_value}} = {{attribute.cpp_value_origi
nal}}; | 40 {{attribute.cpp_type}} {{attribute.cpp_value}} = {{attribute.cpp_value_origi
nal}}; |
| 41 if (UNLIKELY(es.throwIfNeeded())) | 41 if (UNLIKELY(es.throwIfNeeded())) |
| 42 return; | 42 return; |
| 43 {% endif %} | 43 {% endif %} |
| 44 {% if attribute.is_nullable %} | 44 {% if attribute.is_nullable %} |
| 45 bool isNull = false; | 45 bool isNull = false; |
| 46 {{attribute.cpp_type}} {{attribute.cpp_value}} = {{attribute.cpp_value_origi
nal}}; | 46 {{attribute.cpp_type}} {{attribute.cpp_value}} = {{attribute.cpp_value_origi
nal}}; |
| 47 if (isNull) { | 47 if (isNull) { |
| 48 v8SetReturnValueNull(info); | 48 v8SetReturnValueNull(info); |
| 49 return; | 49 return; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 {% if attribute.enum_validation_expression %} | 130 {% if attribute.enum_validation_expression %} |
| 131 {# Setter ignores invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enum
s #} | 131 {# Setter ignores invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enum
s #} |
| 132 String string = cppValue; | 132 String string = cppValue; |
| 133 if (!({{attribute.enum_validation_expression}})) | 133 if (!({{attribute.enum_validation_expression}})) |
| 134 return; | 134 return; |
| 135 {% endif %} | 135 {% endif %} |
| 136 {% if attribute.is_reflect %} | 136 {% if attribute.is_reflect %} |
| 137 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 137 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 138 {% endif %} | 138 {% endif %} |
| 139 {% if attribute.is_setter_raises_exception %} | 139 {% if attribute.is_setter_raises_exception %} |
| 140 ExceptionState es(info.GetIsolate()); | 140 ExceptionState es(info.Holder(), info.GetIsolate()); |
| 141 {% endif %} | 141 {% endif %} |
| 142 {% if attribute.is_call_with_execution_context %} | 142 {% if attribute.is_call_with_execution_context %} |
| 143 ExecutionContext* scriptContext = getExecutionContext(); | 143 ExecutionContext* scriptContext = getExecutionContext(); |
| 144 {% endif %} | 144 {% endif %} |
| 145 {{attribute.cpp_setter}}; | 145 {{attribute.cpp_setter}}; |
| 146 {% if attribute.is_setter_raises_exception %} | 146 {% if attribute.is_setter_raises_exception %} |
| 147 es.throwIfNeeded(); | 147 es.throwIfNeeded(); |
| 148 {% endif %} | 148 {% endif %} |
| 149 {% if attribute.cached_attribute_validation_method %} | 149 {% if attribute.cached_attribute_validation_method %} |
| 150 info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("{{attribute.name}}")
); // Invalidate the cached value. | 150 info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("{{attribute.name}}")
); // Invalidate the cached value. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 178 {% endif %} | 178 {% endif %} |
| 179 {% if attribute.has_custom_setter %} | 179 {% if attribute.has_custom_setter %} |
| 180 {{v8_class_name}}::{{attribute.name}}AttributeSetterCustom(jsValue, info); | 180 {{v8_class_name}}::{{attribute.name}}AttributeSetterCustom(jsValue, info); |
| 181 {% else %} | 181 {% else %} |
| 182 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi
x}}(jsValue, info); | 182 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi
x}}(jsValue, info); |
| 183 {% endif %} | 183 {% endif %} |
| 184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 185 } | 185 } |
| 186 {% endfilter %} | 186 {% endfilter %} |
| 187 {% endmacro %} | 187 {% endmacro %} |
| OLD | NEW |