| 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 "{{cpp_class}}.h" | 6 #include "{{cpp_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 %} |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> c
allback) | 14 {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> c
allback) |
| 15 : m_scriptState(scriptState), | 15 : m_scriptState(scriptState), |
| 16 m_callback(scriptState->isolate(), this, callback) { | 16 m_callback(scriptState->isolate(), this, callback) { |
| 17 DCHECK(!m_callback.isEmpty()); | 17 DCHECK(!m_callback.isEmpty()); |
| 18 m_callback.setPhantom(); | |
| 19 } | 18 } |
| 20 | 19 |
| 21 DEFINE_TRACE({{cpp_class}}) {} | 20 DEFINE_TRACE({{cpp_class}}) {} |
| 22 | 21 |
| 23 DEFINE_TRACE_WRAPPERS({{cpp_class}}) { | 22 DEFINE_TRACE_WRAPPERS({{cpp_class}}) { |
| 24 visitor->traceWrappers(m_callback.cast<v8::Value>()); | 23 visitor->traceWrappers(m_callback.cast<v8::Value>()); |
| 25 } | 24 } |
| 26 | 25 |
| 27 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { | 26 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { |
| 28 if (!m_scriptState->contextIsValid()) | 27 if (!m_scriptState->contextIsValid()) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 returnValue = cppValue; | 63 returnValue = cppValue; |
| 65 {% endif %} | 64 {% endif %} |
| 66 return true; | 65 return true; |
| 67 } | 66 } |
| 68 return false; | 67 return false; |
| 69 } | 68 } |
| 70 | 69 |
| 71 } // namespace blink | 70 } // namespace blink |
| 72 | 71 |
| 73 {% endfilter %}{# format_blink_cpp_source_code #} | 72 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |