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

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

Issue 2023213002: binding: Makes XxxObserverCallback use V8PrivateProperty instead of V8HiddenValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 4 years, 7 months 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 37fd6d40a01542f9166078a45dedfb3a6f525543..866be8f1a2920cc87e501750c700cab0a9c48491 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp
@@ -7,6 +7,7 @@
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8IntersectionObserver.h"
+#include "bindings/core/v8/V8PrivateProperty.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
@@ -17,8 +18,8 @@ V8IntersectionObserverCallback::V8IntersectionObserverCallback(v8::Local<v8::Fun
, m_callback(scriptState->isolate(), callback)
, m_scriptState(scriptState)
{
- V8HiddenValue::setHiddenValue(scriptState, owner, V8HiddenValue::callback(scriptState->isolate()), callback);
- m_callback.setWeak(this, &setWeakCallback);
+ V8PrivateProperty::getIntersectionObserverCallback(scriptState->isolate()).set(scriptState->context(), owner, callback);
+ m_callback.setPhantom();
}
V8IntersectionObserverCallback::~V8IntersectionObserverCallback()
@@ -58,11 +59,6 @@ void V8IntersectionObserverCallback::handleEvent(const HeapVector<Member<Interse
ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate());
}
-void V8IntersectionObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<V8IntersectionObserverCallback>& data)
-{
- data.GetParameter()->m_callback.clear();
-}
-
DEFINE_TRACE(V8IntersectionObserverCallback)
{
IntersectionObserverCallback::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698