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

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

Issue 278803002: Oilpan: Prepare to move IdTargetObserver and IdTargetObserverRegistry to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: apply comments 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
« no previous file with comments | « Source/core/dom/IdTargetObserverRegistry.h ('k') | Source/core/dom/TreeScope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/IdTargetObserverRegistry.cpp
diff --git a/Source/core/dom/IdTargetObserverRegistry.cpp b/Source/core/dom/IdTargetObserverRegistry.cpp
index 80bd6b33f63fa29fecd4ff6e32ea79aaf1ca0f39..36e7f60c8681d007757a25c63ce7d5905294f88d 100644
--- a/Source/core/dom/IdTargetObserverRegistry.cpp
+++ b/Source/core/dom/IdTargetObserverRegistry.cpp
@@ -30,9 +30,15 @@
namespace WebCore {
-PassOwnPtr<IdTargetObserverRegistry> IdTargetObserverRegistry::create()
+PassOwnPtrWillBeRawPtr<IdTargetObserverRegistry> IdTargetObserverRegistry::create()
{
- return adoptPtr(new IdTargetObserverRegistry());
+ return adoptPtrWillBeNoop(new IdTargetObserverRegistry());
+}
+
+void IdTargetObserverRegistry::trace(Visitor* visitor)
+{
+ visitor->trace(m_registry);
+ visitor->trace(m_notifyingObserversInSet);
}
void IdTargetObserverRegistry::addObserver(const AtomicString& id, IdTargetObserver* observer)
@@ -42,7 +48,7 @@ void IdTargetObserverRegistry::addObserver(const AtomicString& id, IdTargetObser
IdToObserverSetMap::AddResult result = m_registry.add(id.impl(), nullptr);
if (result.isNewEntry)
- result.storedValue->value = adoptPtr(new ObserverSet());
+ result.storedValue->value = adoptPtrWillBeNoop(new ObserverSet());
result.storedValue->value->add(observer);
}
@@ -69,9 +75,9 @@ void IdTargetObserverRegistry::notifyObserversInternal(const AtomicString& id)
if (!m_notifyingObserversInSet)
return;
- Vector<IdTargetObserver*> copy;
+ WillBeHeapVector<RawPtrWillBeMember<IdTargetObserver> > copy;
copyToVector(*m_notifyingObserversInSet, copy);
- for (Vector<IdTargetObserver*>::const_iterator it = copy.begin(); it != copy.end(); ++it) {
+ for (WillBeHeapVector<RawPtrWillBeMember<IdTargetObserver> >::const_iterator it = copy.begin(); it != copy.end(); ++it) {
if (m_notifyingObserversInSet->contains(*it))
(*it)->idTargetChanged();
}
@@ -79,7 +85,7 @@ void IdTargetObserverRegistry::notifyObserversInternal(const AtomicString& id)
if (m_notifyingObserversInSet->isEmpty())
m_registry.remove(id.impl());
- m_notifyingObserversInSet = 0;
+ m_notifyingObserversInSet = nullptr;
}
bool IdTargetObserverRegistry::hasObservers(const AtomicString& id) const
« no previous file with comments | « Source/core/dom/IdTargetObserverRegistry.h ('k') | Source/core/dom/TreeScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698