コード例 #1
0
ファイル: CSSSelectorList.cpp プロジェクト: mirror/chromium
unsigned CSSSelectorList::length() const {
  if (!m_selectorArray)
    return 0;
  CSSSelector* current = m_selectorArray;
  while (!current->isLastInSelectorList())
    ++current;
  return (current - m_selectorArray) + 1;
}
コード例 #2
0
ファイル: CSSSelectorList.cpp プロジェクト: windyuuy/opera
void CSSSelectorList::deleteSelectors()
{
    if (!m_selectorArray)
        return;

    for (CSSSelector* s = m_selectorArray; !s->isLastInSelectorList(); ++s)
        s->~CSSSelector();
    fastFree(m_selectorArray);
}
コード例 #3
0
ファイル: CSSSelectorList.cpp プロジェクト: mirror/chromium
void CSSSelectorList::deleteSelectors() {
  ASSERT(m_selectorArray);

  bool finished = false;
  for (CSSSelector* s = m_selectorArray; !finished; ++s) {
    finished = s->isLastInSelectorList();
    s->~CSSSelector();
  }

  WTF::Partitions::fastFree(m_selectorArray);
}
コード例 #4
0
void CSSSelectorList::deleteSelectors()
{
    if (!m_selectorArray)
        return;

    for (CSSSelector* s = m_selectorArray; ; ++s) {
        s->~CSSSelector();
        if (s->isLastInSelectorList())
            break;
    }
    fastFree(m_selectorArray);
}
コード例 #5
0
void CSSSelectorList::deleteSelectors()
{
    if (!m_selectorArray)
        return;

    bool finished = false;
    for (CSSSelector* s = m_selectorArray; !finished; ++s) {
        finished = s->isLastInSelectorList();
        s->~CSSSelector();
    }

    fastFree(m_selectorArray);
}
コード例 #6
0
ファイル: CSSSelectorList.cpp プロジェクト: 13W/phantomjs
void CSSSelectorList::deleteSelectors()
{
    if (!m_selectorArray)
        return;

    // We had two cases in adoptSelectVector. The fast case of a 1 element
    // vector took the CSSSelector directly, which was allocated with new.
    // The second case we allocated a new fastMalloc buffer, which should be
    // freed with fastFree, and the destructors called manually.
    CSSSelector* s = m_selectorArray;
    bool done = s->isLastInSelectorList();
    if (done)
        delete s;
    else {
        while (1) {
            s->~CSSSelector();
            if (done)
                break;
            ++s;
            done = s->isLastInSelectorList();
        }
        fastFree(m_selectorArray);
    }
}