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

Unified Diff: third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl

Issue 2605683002: Remove ActiveDOMCallback (Closed)
Patch Set: temp Created 4 years 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698