Ejemplo n.º 1
0
void CSSImageGeneratorValue::addClient(RenderObject* renderer, const IntSize& size)
{
    ASSERT(renderer);
    ref();

    if (!size.isEmpty())
        m_sizes.add(size);

    RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
    if (it == m_clients.end())
        m_clients.add(renderer, SizeAndCount(size, 1));
    else {
        SizeAndCount& sizeCount = it->value;
        ++sizeCount.count;
    }
}
Ejemplo n.º 2
0
void CSSImageGeneratorValue::addClient(const LayoutObject* layoutObject, const IntSize& size)
{
    ASSERT(layoutObject);
    if (m_clients.isEmpty()) {
        ASSERT(!m_keepAlive);
        m_keepAlive = this;
    }

    if (!size.isEmpty())
        m_sizes.add(size);

    LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject);
    if (it == m_clients.end()) {
        m_clients.add(layoutObject, SizeAndCount(size, 1));
    } else {
        SizeAndCount& sizeCount = it->value;
        ++sizeCount.count;
    }
}