Chromium Code Reviews| Index: Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp |
| diff --git a/Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp b/Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp |
| index ccbbed39b8fba00d16423aee900933929ea26b33..ed4b003be74ab244e40292a7194f2dd44b173e57 100644 |
| --- a/Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp |
| +++ b/Source/core/dom/custom/CustomElementUpgradeCandidateMap.cpp |
| @@ -35,11 +35,20 @@ |
| namespace WebCore { |
| +PassOwnPtrWillBeRawPtr<CustomElementUpgradeCandidateMap> CustomElementUpgradeCandidateMap::create() |
| +{ |
| + return adoptPtrWillBeNoop(new CustomElementUpgradeCandidateMap()); |
| +} |
| + |
| CustomElementUpgradeCandidateMap::~CustomElementUpgradeCandidateMap() |
| { |
| +#if !ENABLE(OILPAN) |
| + // With Oilpan enabled, the observer table keeps a weak reference to the |
|
Mads Ager (chromium)
2014/05/22 08:33:27
The problem is if we have a strong pointer to the
sof
2014/05/25 16:30:01
The registration context (a member on the Document
Mads Ager (chromium)
2014/05/26 10:08:26
That is exactly the right question to ask. :-)
An
sof
2014/05/26 14:21:25
Thanks, that's really useful information. So all t
|
| + // element; no need for explicit removal. |
| UpgradeCandidateMap::const_iterator::Keys end = m_upgradeCandidates.end().keys(); |
| for (UpgradeCandidateMap::const_iterator::Keys it = m_upgradeCandidates.begin().keys(); it != end; ++it) |
| unobserve(*it); |
| +#endif |
| } |
| void CustomElementUpgradeCandidateMap::add(const CustomElementDescriptor& descriptor, Element* element) |
| @@ -98,9 +107,9 @@ void CustomElementUpgradeCandidateMap::moveToEnd(Element* element) |
| elements->value.appendOrMoveToLast(element); |
| } |
| -ListHashSet<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(const CustomElementDescriptor& descriptor) |
| +CustomElementUpgradeCandidateMap::ElementSet CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(const CustomElementDescriptor& descriptor) |
| { |
| - const ListHashSet<Element*>& candidates = m_unresolvedDefinitions.take(descriptor); |
| + const ElementSet& candidates = m_unresolvedDefinitions.take(descriptor); |
| for (ElementSet::const_iterator candidate = candidates.begin(); candidate != candidates.end(); ++candidate) { |
| unobserve(*candidate); |
| @@ -110,4 +119,11 @@ ListHashSet<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor |
| return candidates; |
| } |
| +void CustomElementUpgradeCandidateMap::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_upgradeCandidates); |
| + visitor->trace(m_unresolvedDefinitions); |
| + CustomElementObserver::trace(visitor); |
| +} |
| + |
| } |