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

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

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.h
diff --git a/Source/core/dom/custom/CustomElementObserver.h b/Source/core/dom/custom/CustomElementObserver.h
index ab7c57dcee885f9c961b09f811d96a5412df3584..6af62d5a6cb98254767a307f8980754f12cbbfe8 100644
--- a/Source/core/dom/custom/CustomElementObserver.h
+++ b/Source/core/dom/custom/CustomElementObserver.h
@@ -31,15 +31,15 @@
#ifndef CustomElementObserver_h
#define CustomElementObserver_h
+#include "platform/heap/Handle.h"
#include "wtf/HashMap.h"
namespace WebCore {
class Element;
-class CustomElementObserver {
+class CustomElementObserver : public NoBaseWillBeGarbageCollectedFinalized<CustomElementObserver> {
public:
- CustomElementObserver() { }
virtual ~CustomElementObserver() { }
// API for CustomElement to kick off notifications
@@ -47,18 +47,16 @@ public:
static void notifyElementDidFinishParsingChildren(Element*);
static void notifyElementWasDestroyed(Element*);
+ virtual void trace(Visitor*) { }
+
protected:
+ CustomElementObserver() { }
+
void observe(Element*);
void unobserve(Element*);
virtual void elementDidFinishParsingChildren(Element*) = 0;
virtual void elementWasDestroyed(Element* element) { unobserve(element); }
-
-private:
- // Maps elements to the observer watching them. At most one per
- // element at a time.
- typedef HashMap<Element*, CustomElementObserver*> ElementObserverMap;
- static ElementObserverMap& elementObservers();
};
}

Powered by Google App Engine
This is Rietveld 408576698