inline void CollectionCache::copyCacheMap(NodeCacheMap& dest, const NodeCacheMap& src)
{
    ASSERT(dest.isEmpty());
    NodeCacheMap::const_iterator end = src.end();
    for (NodeCacheMap::const_iterator it = src.begin(); it != end; ++it)
        dest.add(it->first, new Vector<Element*>(*it->second));
}
Ejemplo n.º 2
0
void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element* element)
{
    OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).storedValue->value;
    if (!vector)
        vector = adoptPtr(new Vector<Element*>);
    vector->append(element);
}
Ejemplo n.º 3
0
void HTMLCollectionCacheBase::append(NodeCacheMap& map, const AtomicString& key, Element* element)
{
    OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->second;
    if (!vector)
        vector = adoptPtr(new Vector<Element*>);
    vector->append(element);
}