Changeset 143685 in webkit


Ignore:
Timestamp:
Feb 21, 2013 8:03:41 PM (11 years ago)
Author:
tonyg@chromium.org
Message:

Invalidate outstanding checkpoints for the background input stream and preload scanner
https://bugs.webkit.org/show_bug.cgi?id=110537

Reviewed by Adam Barth.

fast/tokenizer/write-before-load.html caused duplicate didFailSpeculation() calls for the same checkpoint.
One was triggered by processParsedChunkFromBackgroundParser and the other by resumeParsingAfterScriptExecution.
This change ensures that after we send a checkpoint, it is cleared so it won't be sent again until the next
processParsedChunkFromBackgroundParser().

No new tests because no new functionality.

  • html/parser/BackgroundHTMLInputStream.cpp:

(WebCore::BackgroundHTMLInputStream::rewindTo):

  • html/parser/HTMLDocumentParser.cpp:

(WebCore::HTMLDocumentParser::didFailSpeculation):

  • html/parser/HTMLPreloadScanner.cpp:

(WebCore::TokenPreloadScanner::rewindTo):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143684 r143685  
     12013-02-21  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Invalidate outstanding checkpoints for the background input stream and preload scanner
     4        https://bugs.webkit.org/show_bug.cgi?id=110537
     5
     6        Reviewed by Adam Barth.
     7
     8        fast/tokenizer/write-before-load.html caused duplicate didFailSpeculation() calls for the same checkpoint.
     9        One was triggered by processParsedChunkFromBackgroundParser and the other by resumeParsingAfterScriptExecution.
     10        This change ensures that after we send a checkpoint, it is cleared so it won't be sent again until the next
     11        processParsedChunkFromBackgroundParser().
     12
     13        No new tests because no new functionality.
     14
     15        * html/parser/BackgroundHTMLInputStream.cpp:
     16        (WebCore::BackgroundHTMLInputStream::rewindTo):
     17        * html/parser/HTMLDocumentParser.cpp:
     18        (WebCore::HTMLDocumentParser::didFailSpeculation):
     19        * html/parser/HTMLPreloadScanner.cpp:
     20        (WebCore::TokenPreloadScanner::rewindTo):
     21
    1222013-02-21  Dean Jackson  <dino@apple.com>
    223
  • trunk/Source/WebCore/html/parser/BackgroundHTMLInputStream.cpp

    r142673 r143685  
    7272        m_current.close();
    7373
    74     // FIXME: We should be able to actively invalidate all the outstanding checkpoints
    75     // by clearing m_segments and m_checkpoints, but that causes
    76     // fast/tokenizer/write-before-load.html to hit the ASSERT at the beginning of
    77     // this function.
     74    m_segments.clear();
     75    m_checkpoints.clear();
    7876}
    7977
  • trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp

    r143670 r143685  
    309309void HTMLDocumentParser::didFailSpeculation(PassOwnPtr<HTMLToken> token, PassOwnPtr<HTMLTokenizer> tokenizer)
    310310{
     311    if (!m_currentChunk)
     312        return;
     313
    311314    m_weakFactory.revokeAll();
    312315    m_speculations.clear();
     
    320323    checkpoint->unparsedInput = m_input.current().toString().isolatedCopy();
    321324    m_input.current().clear();
     325    m_currentChunk.clear();
    322326
    323327    ASSERT(checkpoint->unparsedInput.isSafeToSendToAnotherThread());
  • trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp

    r143661 r143685  
    284284#endif
    285285    m_cssScanner.reset();
    286 
    287     // FIXME: We should be able to actively invalidate all the outstanding checkpoints
    288     // by clearing m_checkpoints, but that causes fast/tokenizer/write-before-load.html
    289     // to hit the ASSERT at the beginning of this function.
     286    m_checkpoints.clear();
    290287}
    291288
Note: See TracChangeset for help on using the changeset viewer.