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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp

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/core/v8/V8MutationCallback.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp
index 2e37dfe5255e0af8f771904463a02532871be020..a9b62b56ea8de7200b588d5560816130fd4b7ca6 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp
@@ -39,9 +39,7 @@ namespace blink {
V8MutationCallback::V8MutationCallback(v8::Local<v8::Function> callback,
v8::Local<v8::Object> owner,
ScriptState* scriptState)
- : ActiveDOMCallback(scriptState->getExecutionContext()),
- m_callback(scriptState->isolate(), callback),
- m_scriptState(scriptState) {
+ : m_callback(scriptState->isolate(), callback), m_scriptState(scriptState) {
V8PrivateProperty::getMutationObserverCallback(scriptState->isolate())
.set(scriptState->context(), owner, callback);
m_callback.setPhantom();
@@ -52,11 +50,11 @@ V8MutationCallback::~V8MutationCallback() {}
void V8MutationCallback::call(
const HeapVector<Member<MutationRecord>>& mutations,
MutationObserver* observer) {
- if (!canInvokeCallback())
- return;
-
v8::Isolate* isolate = m_scriptState->isolate();
-
+ ExecutionContext* executionContext = m_scriptState->getExecutionContext();
+ if (!executionContext || executionContext->isContextSuspended() ||
+ executionContext->isContextDestroyed())
+ return;
if (!m_scriptState->contextIsValid())
return;
ScriptState::Scope scope(m_scriptState.get());
@@ -85,7 +83,6 @@ void V8MutationCallback::call(
DEFINE_TRACE(V8MutationCallback) {
MutationCallback::trace(visitor);
- ActiveDOMCallback::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698