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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.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/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 1774c8a7ca59a71d69ac94ee1276e8c3bf68a477..e46a248595e4d918227d843546f8014422f4c6d8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp
@@ -26,10 +26,11 @@
#include "bindings/core/v8/V8MutationCallback.h"
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8MutationObserver.h"
#include "bindings/core/v8/V8MutationRecord.h"
+#include "bindings/core/v8/V8PrivateProperty.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
@@ -40,8 +41,8 @@ V8MutationCallback::V8MutationCallback(v8::Local<v8::Function> callback, v8::Loc
, m_callback(scriptState->isolate(), callback)
, m_scriptState(scriptState)
{
- V8HiddenValue::setHiddenValue(scriptState, owner, V8HiddenValue::callback(scriptState->isolate()), callback);
- m_callback.setWeak(this, &setWeakCallback);
+ V8PrivateProperty::getMutationObserverCallback(scriptState->isolate()).set(scriptState->context(), owner, callback);
+ m_callback.setPhantom();
}
V8MutationCallback::~V8MutationCallback()
@@ -82,11 +83,6 @@ void V8MutationCallback::call(const HeapVector<Member<MutationRecord>>& mutation
ScriptController::callFunction(getExecutionContext(), m_callback.newLocal(isolate), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate);
}
-void V8MutationCallback::setWeakCallback(const v8::WeakCallbackInfo<V8MutationCallback>& data)
-{
- data.GetParameter()->m_callback.clear();
-}
-
DEFINE_TRACE(V8MutationCallback)
{
MutationCallback::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698