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

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: Fix compilation issue pointed out by clang 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..9b537447f391adff75405f129e17616069204274 100644
--- a/Source/core/dom/custom/CustomElementObserver.cpp
+++ b/Source/core/dom/custom/CustomElementObserver.cpp
@@ -31,12 +31,18 @@
#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;
+
+static ElementObserverMap& elementObservers()
{
- DEFINE_STATIC_LOCAL(ElementObserverMap, map, ());
- return map;
+ DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ElementObserverMap>, map, (adoptPtrWillBeNoop(new ElementObserverMap())));
+ return *map;
}
void CustomElementObserver::notifyElementDidFinishParsingChildren(Element* element)
« no previous file with comments | « Source/core/dom/custom/CustomElementObserver.h ('k') | Source/core/dom/custom/CustomElementRegistrationContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698