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

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

Issue 1962113003: Make ActiveScriptWrappable the GC mixin it is. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/ActiveScriptWrappable.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp b/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp
index fe1e2109876e1a32ed618ffe409fb4c65694ac2f..088db3b2fe14cd47caec48ffaa62f761c20bbaa7 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp
@@ -13,11 +13,13 @@ namespace blink {
namespace {
-using ActiveScriptWrappableSetType = HashSet<const ActiveScriptWrappable*>;
+using ActiveScriptWrappableSetType = PersistentHeapHashSet<WeakMember<const ActiveScriptWrappable>>;
ActiveScriptWrappableSetType& activeScriptWrappables()
{
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<ActiveScriptWrappableSetType>, activeScriptWrappableSet, new ThreadSpecific<ActiveScriptWrappableSetType>());
haraken 2016/05/10 07:10:27 Not directly related to this CL, shall we move the
sof 2016/05/10 15:46:04 That would avoid ThreadSpecific<> , which would be
+ if (!activeScriptWrappableSet.isSet())
+ activeScriptWrappableSet->registerAsStaticReference();
return *activeScriptWrappableSet;
}
@@ -29,11 +31,6 @@ ActiveScriptWrappable::ActiveScriptWrappable(ScriptWrappable* self)
activeScriptWrappables().add(this);
}
-ActiveScriptWrappable::~ActiveScriptWrappable()
-{
- activeScriptWrappables().remove(this);
-}
-
ScriptWrappable* ActiveScriptWrappable::toScriptWrappable() const
{
return m_scriptWrappable;

Powered by Google App Engine
This is Rietveld 408576698