Changeset 60683 in webkit


Ignore:
Timestamp:
Jun 4, 2010 9:44:16 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-04 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Add a takeFirst() method to Deque and use it where appropriate.
https://bugs.webkit.org/show_bug.cgi?id=40089

  • wtf/Deque.h: (WTF::::takeFirst):
  • wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread):
  • wtf/MessageQueue.h: (WTF::::tryGetMessage):

2010-06-04 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Utilize new takeFirst() method where appropriate.
https://bugs.webkit.org/show_bug.cgi?id=40089

No new tests because no new functionality.

  • css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::addSubresourceStyleURLs):
  • dom/XMLTokenizerLibxml2.cpp: (WebCore::PendingCallbacks::callAndRemoveFirstCallback):
  • html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::reset): (WebCore::HTMLTokenizer::executeExternalScriptsIfReady):
  • platform/text/SegmentedString.cpp: (WebCore::SegmentedString::advanceSubstring):
  • storage/Database.cpp: (WebCore::Database::scheduleTransaction):
  • storage/SQLTransaction.cpp: (WebCore::SQLTransaction::getNextStatement):
  • storage/SQLTransactionCoordinator.cpp: (WebCore::SQLTransactionCoordinator::processPendingTransactions):

2010-06-04 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Utilize new takeFirst() method where appropriate.
https://bugs.webkit.org/show_bug.cgi?id=40089

  • Platform/CoreIPC/ArgumentDecoder.cpp: (CoreIPC::ArgumentDecoder::removeAttachment):

2010-06-04 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Adam Barth.

Utilize new takeFirst() method where appropriate.
https://bugs.webkit.org/show_bug.cgi?id=40089

  • DumpRenderTree/chromium/EventSender.cpp: (EventSender::replaySavedEvents):
  • DumpRenderTree/chromium/LayoutTestController.cpp: (LayoutTestController::WorkQueue::processWork): (LayoutTestController::WorkQueue::reset):
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r60662 r60683  
     12010-06-04  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add a takeFirst() method to Deque and use it where appropriate.
     6        https://bugs.webkit.org/show_bug.cgi?id=40089
     7
     8        * wtf/Deque.h:
     9        (WTF::::takeFirst):
     10        * wtf/MainThread.cpp:
     11        (WTF::dispatchFunctionsFromMainThread):
     12        * wtf/MessageQueue.h:
     13        (WTF::::tryGetMessage):
     14
    1152010-06-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
    216
  • trunk/JavaScriptCore/wtf/Deque.h

    r45073 r60683  
    7373        T& first() { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
    7474        const T& first() const { ASSERT(m_start != m_end); return m_buffer.buffer()[m_start]; }
     75        T takeFirst();
    7576
    7677        template<typename U> void append(const U&);
     
    426427        m_buffer.deallocateBuffer(oldBuffer);
    427428        checkValidity();
     429    }
     430
     431    template<typename T>
     432    inline T Deque<T>::takeFirst()
     433    {
     434        T oldFirst = first();
     435        removeFirst();
     436        return oldFirst;
    428437    }
    429438
  • trunk/JavaScriptCore/wtf/MainThread.cpp

    r59920 r60683  
    150150            if (!functionQueue().size())
    151151                break;
    152             invocation = functionQueue().first();
    153             functionQueue().removeFirst();
     152            invocation = functionQueue().takeFirst();
    154153        }
    155154
  • trunk/JavaScriptCore/wtf/MessageQueue.h

    r51198 r60683  
    164164            return 0;
    165165
    166         DataType* message = m_queue.first();
    167         m_queue.removeFirst();
    168         return message;
     166        return m_queue.takeFirst();
    169167    }
    170168
  • trunk/WebCore/ChangeLog

    r60682 r60683  
     12010-06-04  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Utilize new takeFirst() method where appropriate.
     6        https://bugs.webkit.org/show_bug.cgi?id=40089
     7
     8        No new tests because no new functionality.
     9
     10        * css/CSSStyleSheet.cpp:
     11        (WebCore::CSSStyleSheet::addSubresourceStyleURLs):
     12        * dom/XMLTokenizerLibxml2.cpp:
     13        (WebCore::PendingCallbacks::callAndRemoveFirstCallback):
     14        * html/HTMLTokenizer.cpp:
     15        (WebCore::HTMLTokenizer::reset):
     16        (WebCore::HTMLTokenizer::executeExternalScriptsIfReady):
     17        * platform/text/SegmentedString.cpp:
     18        (WebCore::SegmentedString::advanceSubstring):
     19        * storage/Database.cpp:
     20        (WebCore::Database::scheduleTransaction):
     21        * storage/SQLTransaction.cpp:
     22        (WebCore::SQLTransaction::getNextStatement):
     23        * storage/SQLTransactionCoordinator.cpp:
     24        (WebCore::SQLTransactionCoordinator::processPendingTransactions):
     25
    1262010-06-04  Nikita Vasilyev  <me@elv1s.ru>
    227
  • trunk/WebCore/css/CSSStyleSheet.cpp

    r59848 r60683  
    246246
    247247    while (!styleSheetQueue.isEmpty()) {
    248         CSSStyleSheet* styleSheet = styleSheetQueue.first();
    249         styleSheetQueue.removeFirst();
     248        CSSStyleSheet* styleSheet = styleSheetQueue.takeFirst();
    250249
    251250        for (unsigned i = 0; i < styleSheet->length(); ++i) {
  • trunk/WebCore/dom/XMLTokenizerLibxml2.cpp

    r59556 r60683  
    183183    void callAndRemoveFirstCallback(XMLTokenizer* tokenizer)
    184184    {
    185         OwnPtr<PendingCallback> callback(m_callbacks.first());
    186         m_callbacks.removeFirst();
     185        OwnPtr<PendingCallback> callback(m_callbacks.takeFirst());
    187186        callback->call(tokenizer);
    188187    }
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r60292 r60683  
    215215
    216216    while (!m_pendingScripts.isEmpty()) {
    217         CachedScript* cs = m_pendingScripts.first().get();
    218         m_pendingScripts.removeFirst();
     217        CachedScript* cs = m_pendingScripts.takeFirst().get();
    219218        ASSERT(cache()->disabled() || cs->accessCount() > 0);
    220219        cs->removeClient(this);
     
    20122011            break;
    20132012
    2014         CachedScript* cs = m_pendingScripts.first().get();
    2015         m_pendingScripts.removeFirst();
     2013        CachedScript* cs = m_pendingScripts.takeFirst().get();
    20162014        ASSERT(cache()->disabled() || cs->accessCount() > 0);
    20172015
  • trunk/WebCore/platform/text/SegmentedString.cpp

    r60274 r60683  
    153153{
    154154    if (m_composite) {
    155         m_currentString = m_substrings.first();
    156         m_substrings.removeFirst();
     155        m_currentString = m_substrings.takeFirst();
    157156        if (m_substrings.isEmpty())
    158157            m_composite = false;
  • trunk/WebCore/storage/Database.cpp

    r60513 r60683  
    681681
    682682    if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) {
    683         transaction = m_transactionQueue.first();
    684         m_transactionQueue.removeFirst();
     683        transaction = m_transactionQueue.takeFirst();
    685684    }
    686685
  • trunk/WebCore/storage/SQLTransaction.cpp

    r60513 r60683  
    355355    MutexLocker locker(m_statementMutex);
    356356    if (!m_statementQueue.isEmpty()) {
    357         m_currentStatement = m_statementQueue.first();
    358         m_statementQueue.removeFirst();
     357        m_currentStatement = m_statementQueue.takeFirst();
    359358    }
    360359}
  • trunk/WebCore/storage/SQLTransactionCoordinator.cpp

    r56825 r60683  
    5858    if (firstPendingTransaction->isReadOnly()) {
    5959        do {
    60             firstPendingTransaction = info.pendingTransactions.first();
    61             info.pendingTransactions.removeFirst();
     60            firstPendingTransaction = info.pendingTransactions.takeFirst();
    6261            info.activeReadTransactions.add(firstPendingTransaction);
    6362            firstPendingTransaction->lockAcquired();
  • trunk/WebKit2/ChangeLog

    r60647 r60683  
     12010-06-04  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Utilize new takeFirst() method where appropriate.
     6        https://bugs.webkit.org/show_bug.cgi?id=40089
     7
     8        * Platform/CoreIPC/ArgumentDecoder.cpp:
     9        (CoreIPC::ArgumentDecoder::removeAttachment):
     10
    1112010-06-03  Ada Chan  <adachan@apple.com>
    212
  • trunk/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp

    r57454 r60683  
    186186        return false;
    187187
    188     attachment = m_attachments.first();
    189     m_attachments.removeFirst();
     188    attachment = m_attachments.takeFirst();
    190189    return true;
    191190}
  • trunk/WebKitTools/ChangeLog

    r60678 r60683  
     12010-06-04  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Utilize new takeFirst() method where appropriate.
     6        https://bugs.webkit.org/show_bug.cgi?id=40089
     7
     8        * DumpRenderTree/chromium/EventSender.cpp:
     9        (EventSender::replaySavedEvents):
     10        * DumpRenderTree/chromium/LayoutTestController.cpp:
     11        (LayoutTestController::WorkQueue::processWork):
     12        (LayoutTestController::WorkQueue::reset):
     13
    1142010-06-04  Yael Aharon  <yael.aharon@nokia.com>
    215
  • trunk/WebKitTools/DumpRenderTree/chromium/EventSender.cpp

    r59193 r60683  
    717717    replayingSavedEvents = true;
    718718    while (!mouseEventQueue.isEmpty()) {
    719         SavedEvent e = mouseEventQueue.first();
    720         mouseEventQueue.removeFirst();
     719        SavedEvent e = mouseEventQueue.takeFirst();
    721720
    722721        switch (e.type) {
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r60032 r60683  
    202202    while (!m_queue.isEmpty()) {
    203203        bool startedLoad = m_queue.first()->run(shell);
    204         delete m_queue.first();
    205         m_queue.removeFirst();
     204        delete m_queue.takeFirst();
    206205        if (startedLoad)
    207206            return;
     
    216215    m_frozen = false;
    217216    while (!m_queue.isEmpty()) {
    218         delete m_queue.first();
    219         m_queue.removeFirst();
     217        delete m_queue.takeFirst();
    220218    }
    221219}
Note: See TracChangeset for help on using the changeset viewer.