Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl |
| diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl |
| index f2c6416de79f6eeb72935d70e732b61436434285..a101ddaba03b4e9cbdb6929da443c09cbb0386da 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl |
| +++ b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl |
| @@ -10,8 +10,7 @@ |
| namespace blink { |
| {{v8_class}}::{{v8_class}}(v8::Local<v8::Function> callback, ScriptState* scriptState) |
| - : ActiveDOMCallback(scriptState->getExecutionContext()) |
| - , m_scriptState(scriptState) { |
| + : m_scriptState(scriptState) { |
| m_callback.set(scriptState->isolate(), callback); |
| } |
| @@ -19,19 +18,18 @@ namespace blink { |
| DEFINE_TRACE({{v8_class}}) { |
| {{cpp_class}}::trace(visitor); |
| - ActiveDOMCallback::trace(visitor); |
| } |
| {% for method in methods if not method.is_custom %} |
| {{method.cpp_type}} {{v8_class}}::{{method.name}}({{method.argument_declarations | join(', ')}}) { |
| {% set return_default = 'return true' |
| if method.idl_type == 'boolean' else 'return' %}{# void #} |
| - if (!canInvokeCallback()) |
| + ExecutionContext* executionContext = m_scriptState->getExecutionContext(); |
| + if (!executionContext || executionContext->isContextSuspended() || |
| + executionContext->isContextDestroyed()) |
| {{return_default}}; |
| - |
| if (!m_scriptState->contextIsValid()) |
|
haraken
2016/12/27 15:09:18
I guess this check won't be needed because !m_scri
|
| {{return_default}}; |
| - |
| ScriptState::Scope scope(m_scriptState.get()); |
| {% if method.call_with_this_handle %} |
| v8::Local<v8::Value> thisHandle = thisValue.v8Value(); |