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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 v8SetReturnValueNull(info); | 91 v8SetReturnValueNull(info); |
92 return; | 92 return; |
93 } | 93 } |
94 {% endif %} | 94 {% endif %} |
95 {% if attribute.cached_attribute_validation_method %} | 95 {% if attribute.cached_attribute_validation_method %} |
96 setHiddenValue(info.GetIsolate(), info.Holder(), propertyName, {{attribute.c
pp_value}}.v8Value()); | 96 setHiddenValue(info.GetIsolate(), info.Holder(), propertyName, {{attribute.c
pp_value}}.v8Value()); |
97 {% endif %} | 97 {% endif %} |
98 {# v8SetReturnValue #} | 98 {# v8SetReturnValue #} |
99 {% if attribute.is_keep_alive_for_gc %} | 99 {% if attribute.is_keep_alive_for_gc %} |
100 {# FIXME: merge local variable assignment with above #} | 100 {# FIXME: merge local variable assignment with above #} |
101 {{attribute.cpp_type}} result = {{attribute.cpp_value}}; | 101 {{attribute.cpp_type}} result({{attribute.cpp_value}}); |
102 if (result && DOMDataStore::setReturnValueFromWrapper{{world_suffix}}<{{attr
ibute.v8_type}}>(info.GetReturnValue(), result.get())) | 102 if (result && DOMDataStore::setReturnValueFromWrapper{{world_suffix}}<{{attr
ibute.v8_type}}>(info.GetReturnValue(), result.get())) |
103 return; | 103 return; |
104 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 104 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
105 if (!wrapper.IsEmpty()) { | 105 if (!wrapper.IsEmpty()) { |
106 setHiddenValue(info.GetIsolate(), info.Holder(), "{{attribute.name}}", w
rapper); | 106 setHiddenValue(info.GetIsolate(), info.Holder(), "{{attribute.name}}", w
rapper); |
107 {{attribute.v8_set_return_value}}; | 107 {{attribute.v8_set_return_value}}; |
108 } | 108 } |
109 {% elif world_suffix %} | 109 {% elif world_suffix %} |
110 {{attribute.v8_set_return_value_for_main_world}}; | 110 {{attribute.v8_set_return_value_for_main_world}}; |
111 {% else %} | 111 {% else %} |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 {# Type checking for interface types (if interface not implemented, throw | 206 {# Type checking for interface types (if interface not implemented, throw |
207 TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} | 207 TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} |
208 if (!isUndefinedOrNull(jsValue) && !V8{{attribute.idl_type}}::hasInstance(js
Value, info.GetIsolate())) { | 208 if (!isUndefinedOrNull(jsValue) && !V8{{attribute.idl_type}}::hasInstance(js
Value, info.GetIsolate())) { |
209 exceptionState.throwTypeError("The provided value is not of type '{{attr
ibute.idl_type}}'."); | 209 exceptionState.throwTypeError("The provided value is not of type '{{attr
ibute.idl_type}}'."); |
210 exceptionState.throwIfNeeded(); | 210 exceptionState.throwIfNeeded(); |
211 return; | 211 return; |
212 } | 212 } |
213 {% endif %} | 213 {% endif %} |
214 {% if attribute.put_forwards %} | 214 {% if attribute.put_forwards %} |
215 {{cpp_class}}* proxyImp = {{v8_class}}::toNative(info.Holder()); | 215 {{cpp_class}}* proxyImp = {{v8_class}}::toNative(info.Holder()); |
216 {{attribute.idl_type}}* imp = proxyImp->{{attribute.name}}(); | 216 {{attribute.idl_type}}* imp = WTF::getPtr(proxyImp->{{attribute.name}}()); |
217 if (!imp) | 217 if (!imp) |
218 return; | 218 return; |
219 {% elif not attribute.is_static %} | 219 {% elif not attribute.is_static %} |
220 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder()); | 220 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder()); |
221 {% endif %}{# imp #} | 221 {% endif %}{# imp #} |
222 {# FIXME: move ASSERT(imp) here. #} | 222 {# FIXME: move ASSERT(imp) here. #} |
223 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} | 223 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} |
224 if (!imp->document()) | 224 if (!imp->document()) |
225 return; | 225 return; |
226 {% endif %} | 226 {% endif %} |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 {% endif %} | 296 {% endif %} |
297 {% if attribute.has_custom_setter %} | 297 {% if attribute.has_custom_setter %} |
298 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(jsValue, info); | 298 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(jsValue, info); |
299 {% else %} | 299 {% else %} |
300 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(j
sValue, info); | 300 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(j
sValue, info); |
301 {% endif %} | 301 {% endif %} |
302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
303 } | 303 } |
304 {% endfilter %} | 304 {% endfilter %} |
305 {% endmacro %} | 305 {% endmacro %} |
OLD | NEW |