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

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

Issue 25675003: IDL compiler: remove nop return from end of getters and setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro attribute_getter(attribute) %} 2 {% macro attribute_getter(attribute) %}
3 static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) 3 static void {{attribute.name}}AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
4 { 4 {
5 {% if not attribute.is_static %} 5 {% if not attribute.is_static %}
6 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); 6 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
7 {% endif %} 7 {% endif %}
8 {% if attribute.is_nullable %} 8 {% if attribute.is_nullable %}
9 bool isNull = false; 9 bool isNull = false;
10 {{attribute.cpp_type}} value = {{attribute.cpp_value_original}}; 10 {{attribute.cpp_type}} value = {{attribute.cpp_value_original}};
11 if (isNull) { 11 if (isNull) {
12 v8SetReturnValueNull(info); 12 v8SetReturnValueNull(info);
13 return; 13 return;
14 } 14 }
15 {% endif %} 15 {% endif %}
16 {% if attribute.is_keep_alive_for_gc %} 16 {% if attribute.is_keep_alive_for_gc %}
17 {{attribute.cpp_type}} result = {{attribute.cpp_value}}; 17 {{attribute.cpp_type}} result = {{attribute.cpp_value}};
18 if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_t ype}}>(info.GetReturnValue(), result.get())) 18 if (result.get() && DOMDataStore::setReturnValueFromWrapper<{{attribute.v8_t ype}}>(info.GetReturnValue(), result.get()))
19 return; 19 return;
20 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs olate()); 20 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs olate());
21 if (!wrapper.IsEmpty()) { 21 if (!wrapper.IsEmpty()) {
22 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribut e.name}}", wrapper); 22 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "{{attribut e.name}}", wrapper);
23 v8SetReturnValue(info, wrapper); 23 v8SetReturnValue(info, wrapper);
24 } 24 }
25 {% else %} 25 {% else %}
26 {{attribute.return_v8_value_statement}} 26 {{attribute.return_v8_value_statement}}
27 {% endif %} 27 {% endif %}
28 return;
29 } 28 }
30 {% endmacro %} 29 {% endmacro %}
31 30
32 31
33 {##############################################################################} 32 {##############################################################################}
34 {% macro attribute_getter_callback(attribute) %} 33 {% macro attribute_getter_callback(attribute) %}
35 static void {{attribute.name}}AttributeGetterCallback(v8::Local<v8::String> name , const v8::PropertyCallbackInfo<v8::Value>& info) 34 static void {{attribute.name}}AttributeGetterCallback(v8::Local<v8::String> name , const v8::PropertyCallbackInfo<v8::Value>& info)
36 { 35 {
37 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 36 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
38 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter(name, info); 37 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter(name, info);
39 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 38 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
40 } 39 }
41 {% endmacro %} 40 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/tests/results/V8TestActiveDOMObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698