| 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 %} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DEFINE_TRACE_WRAPPERS({{cpp_class}}) { | 22 DEFINE_TRACE_WRAPPERS({{cpp_class}}) { |
| 23 visitor->traceWrappers(m_callback.cast<v8::Value>()); | 23 visitor->traceWrappers(m_callback.cast<v8::Value>()); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { | 26 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { |
| 27 if (!m_scriptState->contextIsValid()) | 27 if (!m_scriptState->contextIsValid()) |
| 28 return false; | 28 return false; |
| 29 | 29 |
| 30 ExecutionContext* context = m_scriptState->getExecutionContext(); | 30 ExecutionContext* context = m_scriptState->getExecutionContext(); |
| 31 DCHECK(context); | 31 DCHECK(context); |
| 32 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreSto
pped()) | 32 if (context->activeDOMObjectsAreSuspended() || context->isContextDestroyed()) |
| 33 return false; | 33 return false; |
| 34 | 34 |
| 35 if (m_callback.isEmpty()) | 35 if (m_callback.isEmpty()) |
| 36 return false; | 36 return false; |
| 37 | 37 |
| 38 // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. | 38 // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. |
| 39 // crbug.com/653769 | 39 // crbug.com/653769 |
| 40 DummyExceptionStateForTesting exceptionState; | 40 DummyExceptionStateForTesting exceptionState; |
| 41 ScriptState::Scope scope(m_scriptState.get()); | 41 ScriptState::Scope scope(m_scriptState.get()); |
| 42 | 42 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 returnValue = cppValue; | 63 returnValue = cppValue; |
| 64 {% endif %} | 64 {% endif %} |
| 65 return true; | 65 return true; |
| 66 } | 66 } |
| 67 return false; | 67 return false; |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace blink | 70 } // namespace blink |
| 71 | 71 |
| 72 {% endfilter %}{# format_blink_cpp_source_code #} | 72 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |