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

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

Issue 357413003: IDL: Drop redundant null check for string and wrapper type attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 exceptionState.throwIfNeeded(); 62 exceptionState.throwIfNeeded();
63 return; 63 return;
64 } 64 }
65 {% endif %} 65 {% endif %}
66 {% if attribute.reflect_only %} 66 {% if attribute.reflect_only %}
67 {{release_only_check(attribute.reflect_only, attribute.reflect_missing, 67 {{release_only_check(attribute.reflect_only, attribute.reflect_missing,
68 attribute.reflect_invalid, attribute.reflect_empty, 68 attribute.reflect_invalid, attribute.reflect_empty,
69 attribute.cpp_value) 69 attribute.cpp_value)
70 | indent}} 70 | indent}}
71 {% endif %} 71 {% endif %}
72 {% if attribute.is_nullable %} 72 {% if attribute.is_nullable and not attribute.is_nullable_simple %}
73 {% if attribute.is_nullable_simple %}
74 if (!{{attribute.cpp_value}}) {
75 {% else %}
76 if (isNull) { 73 if (isNull) {
77 {% endif %}
78 v8SetReturnValueNull(info); 74 v8SetReturnValueNull(info);
79 return; 75 return;
80 } 76 }
81 {% endif %} 77 {% endif %}
82 {% if attribute.cached_attribute_validation_method %} 78 {% if attribute.cached_attribute_validation_method %}
83 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att ribute.cpp_value_to_v8_value}}); 79 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att ribute.cpp_value_to_v8_value}});
84 {% endif %} 80 {% endif %}
85 {# v8SetReturnValue #} 81 {# v8SetReturnValue #}
86 {% if attribute.is_keep_alive_for_gc %} 82 {% if attribute.is_keep_alive_for_gc %}
87 if ({{attribute.cpp_value}} && DOMDataStore::setReturnValueFromWrapper{{worl d_suffix}}<{{attribute.v8_type}}>(info.GetReturnValue(), {{attribute.cpp_value}} .get())) 83 if ({{attribute.cpp_value}} && DOMDataStore::setReturnValueFromWrapper{{worl d_suffix}}<{{attribute.v8_type}}>(info.GetReturnValue(), {{attribute.cpp_value}} .get()))
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 {% endif %} 327 {% endif %}
332 {% if attribute.has_custom_setter %} 328 {% if attribute.has_custom_setter %}
333 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 329 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
334 {% else %} 330 {% else %}
335 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info); 331 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v 8Value, info);
336 {% endif %} 332 {% endif %}
337 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 333 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
338 } 334 }
339 {% endfilter %} 335 {% endfilter %}
340 {% endmacro %} 336 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698