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

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

Issue 282263007: Fix bindings when using [CachedAttribute] on Array. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@language_change_tests
Patch Set: review comments Created 6 years, 7 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
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 {% if attribute.has_type_checking_nullable %} 88 {% if attribute.has_type_checking_nullable %}
89 if (!{{attribute.cpp_value}}) { 89 if (!{{attribute.cpp_value}}) {
90 {% else %} 90 {% else %}
91 if (isNull) { 91 if (isNull) {
92 {% endif %} 92 {% endif %}
93 v8SetReturnValueNull(info); 93 v8SetReturnValueNull(info);
94 return; 94 return;
95 } 95 }
96 {% endif %} 96 {% endif %}
97 {% if attribute.cached_attribute_validation_method %} 97 {% if attribute.cached_attribute_validation_method %}
98 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att ribute.cpp_value}}.v8Value()); 98 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att ribute.cpp_value_to_v8_value}});
99 {% endif %} 99 {% endif %}
100 {# v8SetReturnValue #} 100 {# v8SetReturnValue #}
101 {% if attribute.is_keep_alive_for_gc %} 101 {% if attribute.is_keep_alive_for_gc %}
102 {# FIXME: merge local variable assignment with above #} 102 {# FIXME: merge local variable assignment with above #}
103 {{attribute.cpp_type}} result({{attribute.cpp_value}}); 103 {{attribute.cpp_type}} result({{attribute.cpp_value}});
104 if (result && DOMDataStore::setReturnValueFromWrapper{{world_suffix}}<{{attr ibute.v8_type}}>(info.GetReturnValue(), result.get())) 104 if (result && DOMDataStore::setReturnValueFromWrapper{{world_suffix}}<{{attr ibute.v8_type}}>(info.GetReturnValue(), result.get()))
105 return; 105 return;
106 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate() ); 106 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate() );
107 if (!wrapper.IsEmpty()) { 107 if (!wrapper.IsEmpty()) {
108 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString( info.GetIsolate(), "{{attribute.name}}"), wrapper); 108 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString( info.GetIsolate(), "{{attribute.name}}"), wrapper);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 {% endif %} 342 {% endif %}
343 {% if attribute.has_custom_setter %} 343 {% if attribute.has_custom_setter %}
344 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 344 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
345 {% else %} 345 {% else %}
346 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); 346 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info);
347 {% endif %} 347 {% endif %}
348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
349 } 349 }
350 {% endfilter %} 350 {% endfilter %}
351 {% endmacro %} 351 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698