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

Unified Diff: Source/core/dom/custom/CustomElementObserver.cpp

Issue 296703009: Oilpan: move custom element objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use LinkedHashSet for ElementSet instead. Created 6 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: Source/core/dom/custom/CustomElementObserver.cpp
diff --git a/Source/core/dom/custom/CustomElementObserver.cpp b/Source/core/dom/custom/CustomElementObserver.cpp
index 94247fccecc50495716d4ac701a9ec1abe1462fc..3988dfc1e805ef4e574d7c4da652ba3336735ff5 100644
--- a/Source/core/dom/custom/CustomElementObserver.cpp
+++ b/Source/core/dom/custom/CustomElementObserver.cpp
@@ -31,12 +31,23 @@
#include "config.h"
#include "core/dom/custom/CustomElementObserver.h"
+#include "core/dom/Element.h"
+
namespace WebCore {
-CustomElementObserver::ElementObserverMap& CustomElementObserver::elementObservers()
+// Maps elements to the observer watching them. At most one per
+// element at a time.
+typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Element>, RawPtrWillBeMember<CustomElementObserver> > ElementObserverMap;
haraken 2014/05/26 15:40:23 I think you need to remove the following lines fro
sof 2014/05/26 16:41:08 Very good catch; made it conditional on !ENABLE(OI
sof 2014/05/26 19:25:37 Just to continue that thought & looking at details
+
+static ElementObserverMap& elementObservers()
{
+#if ENABLE(OILPAN)
+ DEFINE_STATIC_LOCAL(Persistent<ElementObserverMap>, map, (new ElementObserverMap()));
+ return *map;
+#else
DEFINE_STATIC_LOCAL(ElementObserverMap, map, ());
return map;
+#endif
}
void CustomElementObserver::notifyElementDidFinishParsingChildren(Element* element)

Powered by Google App Engine
This is Rietveld 408576698