コード例 #1
0
bool IdTargetObserverRegistry::hasObservers(const AtomicString& id) const
{
    if (id.isEmpty() || m_registry.isEmpty())
        return false;
    ObserverSet* set = m_registry.get(id.impl());
    return set && !set->isEmpty();
}
コード例 #2
0
void IdTargetObserverRegistry::removeObserver(const AtomicString& id, IdTargetObserver* observer)
{
    if (id.isEmpty() || m_registry.isEmpty())
        return;

    IdToObserverSetMap::iterator iter = m_registry.find(id.impl());

    ObserverSet* set = iter->value.get();
    set->remove(observer);
    if (set->isEmpty() && set != m_notifyingObserversInSet)
        m_registry.remove(iter);
}