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

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

Issue 390223004: initialize result variables in v8 bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixups for jens 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
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/templates/methods.cpp » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 43 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
44 {% endif %} 44 {% endif %}
45 {% if attribute.is_check_security_for_node or 45 {% if attribute.is_check_security_for_node or
46 attribute.is_getter_raises_exception %} 46 attribute.is_getter_raises_exception %}
47 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate()); 47 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na me}}", "{{interface_name}}", holder, info.GetIsolate());
48 {% endif %} 48 {% endif %}
49 {% if attribute.is_explicit_nullable %} 49 {% if attribute.is_explicit_nullable %}
50 bool isNull = false; 50 bool isNull = false;
51 {% endif %} 51 {% endif %}
52 {% if attribute.is_implemented_in_private_script %} 52 {% if attribute.is_implemented_in_private_script %}
53 {{attribute.cpp_type}} result; 53 {{attribute.cpp_type}} result{{attribute.cpp_type_initializer}};
54 if (!{{attribute.cpp_value_original}}) 54 if (!{{attribute.cpp_value_original}})
55 return; 55 return;
56 {% elif attribute.cpp_value_original %} 56 {% elif attribute.cpp_value_original %}
57 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina l}}); 57 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina l}});
58 {% endif %} 58 {% endif %}
59 {# Checks #} 59 {# Checks #}
60 {% if attribute.is_getter_raises_exception %} 60 {% if attribute.is_getter_raises_exception %}
61 if (UNLIKELY(exceptionState.throwIfNeeded())) 61 if (UNLIKELY(exceptionState.throwIfNeeded()))
62 return; 62 return;
63 {% endif %} 63 {% endif %}
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (block.HasCaught()) { 396 if (block.HasCaught()) {
397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
398 // FIXME: We should support exceptions other than DOM exceptions. 398 // FIXME: We should support exceptions other than DOM exceptions.
399 RELEASE_ASSERT_NOT_REACHED(); 399 RELEASE_ASSERT_NOT_REACHED();
400 } 400 }
401 return false; 401 return false;
402 } 402 }
403 return true; 403 return true;
404 } 404 }
405 {% endmacro %} 405 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698