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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl

Issue 2350813005: bindings: Support sequence in callback function arguments (Closed)
Patch Set: rebase Created 4 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
OLDNEW
1 {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %} 1 {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %}
2 {% filter format_blink_cpp_source_code %} 2 {% filter format_blink_cpp_source_code %}
3 3
4 {% include 'copyright_block.txt' %} 4 {% include 'copyright_block.txt' %}
5 5
6 #include "{{v8_class}}.h" 6 #include "{{v8_class}}.h"
7 7
8 {% for filename in cpp_includes %} 8 {% for filename in cpp_includes %}
9 #include "{{filename}}" 9 #include "{{filename}}"
10 {% endfor %} 10 {% endfor %}
(...skipping 11 matching lines...) Expand all
22 { 22 {
23 } 23 }
24 24
25 bool {{v8_class}}::call({{argument_declarations | join(', ')}}) 25 bool {{v8_class}}::call({{argument_declarations | join(', ')}})
26 { 26 {
27 if (!scriptState->contextIsValid()) 27 if (!scriptState->contextIsValid())
28 return false; 28 return false;
29 29
30 if (m_callback.isEmpty()) 30 if (m_callback.isEmpty())
31 return false; 31 return false;
32
32 ScriptState::Scope scope(scriptState); 33 ScriptState::Scope scope(scriptState);
33 34
34 {% for argument in arguments %} 35 {% for argument in arguments %}
35 v8::Local<v8::Value> {{argument.argument_name}} = {{argument.cpp_value_to_v8 _value}}; 36 v8::Local<v8::Value> {{argument.argument_name}} = {{argument.cpp_value_to_v8 _value}};
36 {% endfor %} 37 {% endfor %}
37 38
38 v8::Local<v8::Value> thisValue = toV8(scriptWrappable, scriptState->context( )->Global(), scriptState->isolate()); 39 v8::Local<v8::Value> thisValue = toV8(scriptWrappable, scriptState->context( )->Global(), scriptState->isolate());
39 40
40 {% if arguments %} 41 {% if arguments %}
41 v8::Local<v8::Value> argv[] = { {{arguments | join(', ', 'argument_name')}} }; 42 v8::Local<v8::Value> argv[] = { {{arguments | join(', ', 'argument_name')}} };
(...skipping 13 matching lines...) Expand all
55 returnValue = cppValue; 56 returnValue = cppValue;
56 {% endif %} 57 {% endif %}
57 return true; 58 return true;
58 } 59 }
59 return false; 60 return false;
60 } 61 }
61 62
62 } // namespace blink 63 } // namespace blink
63 64
64 {% endfilter %}{# format_blink_cpp_source_code #} 65 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698