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

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

Issue 296703009: Oilpan: move custom element objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/CustomElementUpgradeCandidateMap.h
diff --git a/Source/core/dom/custom/CustomElementUpgradeCandidateMap.h b/Source/core/dom/custom/CustomElementUpgradeCandidateMap.h
index f68c50b65be76cea7412a881ba3ae7c256da5742..80e343be9b1f445c49ab3aad83a3c39c32e3bed5 100644
--- a/Source/core/dom/custom/CustomElementUpgradeCandidateMap.h
+++ b/Source/core/dom/custom/CustomElementUpgradeCandidateMap.h
@@ -42,31 +42,35 @@ namespace WebCore {
class Element;
-class CustomElementUpgradeCandidateMap : CustomElementObserver {
+class CustomElementUpgradeCandidateMap FINAL : public CustomElementObserver {
WTF_MAKE_NONCOPYABLE(CustomElementUpgradeCandidateMap);
public:
- CustomElementUpgradeCandidateMap() { }
- ~CustomElementUpgradeCandidateMap();
+ static PassOwnPtrWillBeRawPtr<CustomElementUpgradeCandidateMap> create();
+ virtual ~CustomElementUpgradeCandidateMap();
// API for CustomElementRegistrationContext to save and take candidates
- typedef ListHashSet<Element*> ElementSet;
+ typedef WillBeHeapListHashSet<RawPtrWillBeMember<Element> > ElementSet;
void add(const CustomElementDescriptor&, Element*);
void remove(Element*);
ElementSet takeUpgradeCandidatesFor(const CustomElementDescriptor&);
+ virtual void trace(Visitor*) OVERRIDE;
+
private:
+ CustomElementUpgradeCandidateMap() { }
+
virtual void elementWasDestroyed(Element*) OVERRIDE;
void removeCommon(Element*);
virtual void elementDidFinishParsingChildren(Element*) OVERRIDE;
void moveToEnd(Element*);
- typedef HashMap<Element*, CustomElementDescriptor> UpgradeCandidateMap;
+ typedef WillBeHeapHashMap<RawPtrWillBeMember<Element>, CustomElementDescriptor> UpgradeCandidateMap;
haraken 2014/05/22 08:24:10 Shouldn't the key Element be a weak member?
Mads Ager (chromium) 2014/05/22 08:33:27 Will the m_upgradeCandidates map always end up emp
UpgradeCandidateMap m_upgradeCandidates;
- typedef HashMap<CustomElementDescriptor, ElementSet> UnresolvedDefinitionMap;
+ typedef WillBeHeapHashMap<CustomElementDescriptor, ElementSet> UnresolvedDefinitionMap;
haraken 2014/05/22 08:24:10 This looks OK. The ElementSet can be a hash set of
wibling-chromium 2014/05/22 09:06:05 I cannot find where this is explicitly cleared? Th
sof 2014/05/25 16:30:01 Whether or not to use weak references in ElementSe
UnresolvedDefinitionMap m_unresolvedDefinitions;
};

Powered by Google App Engine
This is Rietveld 408576698