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

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

Issue 2086553002: Refactor ScriptWrappableVisitor.markWrapper(PersistentBase) to be instance method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace fix Created 4 years, 6 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/ScriptWrappableVisitor.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
index fe8678406ac6c99058512150f298a8ef83af7333..dd674b0191a48c2680a2a3a280dd56bac4e1b767 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
@@ -6,6 +6,7 @@
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/DOMWrapperWorld.h"
+#include "bindings/core/v8/V8AbstractEventListener.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "core/dom/DocumentStyleSheetCollection.h"
#include "core/dom/ElementRareData.h"
@@ -109,13 +110,27 @@ bool ScriptWrappableVisitor::markWrapperHeader(HeapObjectHeader* header) const
void ScriptWrappableVisitor::markWrappersInAllWorlds(const ScriptWrappable* scriptWrappable) const
{
- DOMWrapperWorld::markWrappersInAllWorlds(const_cast<ScriptWrappable*>(scriptWrappable), m_isolate);
+ DOMWrapperWorld::markWrappersInAllWorlds(const_cast<ScriptWrappable*>(scriptWrappable), this);
}
void ScriptWrappableVisitor::traceWrappers(const ScopedPersistent<v8::Value>* scopedPersistent) const
{
- markWrapper(
- &(const_cast<ScopedPersistent<v8::Value>*>(scopedPersistent)->get()));
+ markWrapper(&(const_cast<ScopedPersistent<v8::Value>*>(scopedPersistent)->get()));
+}
+
+void ScriptWrappableVisitor::traceWrappers(const ScopedPersistent<v8::Object>* scopedPersistent) const
+{
+ markWrapper(&(const_cast<ScopedPersistent<v8::Object>*>(scopedPersistent)->get()));
+}
+
+void ScriptWrappableVisitor::markWrapper(const v8::PersistentBase<v8::Value>* handle) const
+{
+ handle->RegisterExternalReference(m_isolate);
+}
+
+void ScriptWrappableVisitor::markWrapper(const v8::PersistentBase<v8::Object>* handle) const
+{
+ handle->RegisterExternalReference(m_isolate);
}
void ScriptWrappableVisitor::dispatchTraceWrappers(const ScriptWrappable* wrappable) const

Powered by Google App Engine
This is Rietveld 408576698