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

Unified Diff: Source/core/dom/CustomElementUpgradeCandidateMap.cpp

Issue 22847004: Rename CustomElementUpgradeCandidateMap::DestructionObserverMap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
« no previous file with comments | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementUpgradeCandidateMap.cpp
diff --git a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
index c84bcb7dec56a504de7c372580cac0a3da08e967..2f80c7716a0e108477c668609d11297e89e2a1b4 100644
--- a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
+++ b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
@@ -39,14 +39,14 @@ CustomElementUpgradeCandidateMap::~CustomElementUpgradeCandidateMap()
{
UpgradeCandidateMap::const_iterator::Keys end = m_upgradeCandidates.end().keys();
for (UpgradeCandidateMap::const_iterator::Keys it = m_upgradeCandidates.begin().keys(); it != end; ++it)
- unregisterForElementDestructionNotification(*it, this);
+ unobserve(*it);
}
void CustomElementUpgradeCandidateMap::add(const CustomElementDescriptor& descriptor, Element* element)
{
element->setCustomElementState(Element::UpgradeCandidate);
- registerForElementDestructionNotification(element, this);
+ observe(element);
UpgradeCandidateMap::AddResult result = m_upgradeCandidates.add(element, descriptor);
ASSERT(result.isNewEntry);
@@ -59,7 +59,7 @@ void CustomElementUpgradeCandidateMap::add(const CustomElementDescriptor& descri
void CustomElementUpgradeCandidateMap::remove(Element* element)
{
- unregisterForElementDestructionNotification(element, this);
+ unobserve(element);
UpgradeCandidateMap::iterator candidate = m_upgradeCandidates.find(element);
ASSERT(candidate != m_upgradeCandidates.end());
@@ -75,7 +75,7 @@ ListHashSet<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor
const ListHashSet<Element*>& candidates = m_unresolvedDefinitions.take(descriptor);
for (ElementSet::const_iterator candidate = candidates.begin(); candidate != candidates.end(); ++candidate) {
- unregisterForElementDestructionNotification(*candidate, this);
+ unobserve(*candidate);
m_upgradeCandidates.remove(*candidate);
}
@@ -84,28 +84,28 @@ ListHashSet<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor
void CustomElementUpgradeCandidateMap::elementWasDestroyed(Element* element)
{
- DestructionObserverMap::iterator it = destructionObservers().find(element);
- if (it == destructionObservers().end())
+ ElementObserverMap::iterator it = elementObservers().find(element);
+ if (it == elementObservers().end())
return;
it->value->remove(element); // will also remove the destruction observer
}
-CustomElementUpgradeCandidateMap::DestructionObserverMap& CustomElementUpgradeCandidateMap::destructionObservers()
+CustomElementUpgradeCandidateMap::ElementObserverMap& CustomElementUpgradeCandidateMap::elementObservers()
{
- DEFINE_STATIC_LOCAL(DestructionObserverMap, map, ());
+ DEFINE_STATIC_LOCAL(ElementObserverMap, map, ());
return map;
}
-void CustomElementUpgradeCandidateMap::registerForElementDestructionNotification(Element* element, CustomElementUpgradeCandidateMap* observer)
+void CustomElementUpgradeCandidateMap::observe(Element* element)
{
- DestructionObserverMap::AddResult result = destructionObservers().add(element, observer);
+ ElementObserverMap::AddResult result = elementObservers().add(element, this);
ASSERT(result.isNewEntry);
}
-void CustomElementUpgradeCandidateMap::unregisterForElementDestructionNotification(Element* element, CustomElementUpgradeCandidateMap* observer)
+void CustomElementUpgradeCandidateMap::unobserve(Element* element)
{
- CustomElementUpgradeCandidateMap* map = destructionObservers().take(element);
- ASSERT(map == observer);
+ CustomElementUpgradeCandidateMap* map = elementObservers().take(element);
+ ASSERT(map == this);
}
}
« no previous file with comments | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698