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/core/v8/V8IntersectionObserverCallback.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/V8IntersectionObserverCallback.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp
index 43f8a72631b87b9f1ec9d00591717ce816085add..5f21bb595ac048d472efeeb678da882875e66bd2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp
@@ -17,9 +17,7 @@ V8IntersectionObserverCallback::V8IntersectionObserverCallback(
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::getIntersectionObserverCallback(scriptState->isolate())
.set(scriptState->context(), owner, callback);
m_callback.setPhantom();
@@ -30,9 +28,10 @@ V8IntersectionObserverCallback::~V8IntersectionObserverCallback() {}
void V8IntersectionObserverCallback::handleEvent(
const HeapVector<Member<IntersectionObserverEntry>>& entries,
IntersectionObserver& observer) {
- if (!canInvokeCallback())
+ ExecutionContext* executionContext = m_scriptState->getExecutionContext();
+ if (!executionContext || executionContext->isContextSuspended() ||
+ executionContext->isContextDestroyed())
return;
-
if (!m_scriptState->contextIsValid())
return;
ScriptState::Scope scope(m_scriptState.get());
@@ -62,7 +61,6 @@ void V8IntersectionObserverCallback::handleEvent(
DEFINE_TRACE(V8IntersectionObserverCallback) {
IntersectionObserverCallback::trace(visitor);
- ActiveDOMCallback::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698