OLD | NEW |
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 Loading... |
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 Loading... |
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 #} |
OLD | NEW |