Changeset 147413 in webkit


Ignore:
Timestamp:
Apr 2, 2013 3:21:01 AM (11 years ago)
Author:
shinyak@chromium.org
Message:

Unreviewed, rolling out r147383.
http://trac.webkit.org/changeset/147383
https://bugs.webkit.org/show_bug.cgi?id=112369

Speculative rollout because of lots of layout test failure

  • html/parser/HTMLDocumentParser.cpp:

(WebCore::HTMLDocumentParser::~HTMLDocumentParser):
(WebCore::HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser):
(WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser):
(WebCore::HTMLDocumentParser::pumpPendingSpeculations):
(WebCore::HTMLDocumentParser::insert):

  • html/parser/HTMLParserScheduler.cpp:

(WebCore::PumpSession::PumpSession):

  • html/parser/HTMLParserScheduler.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147412 r147413  
     12013-04-02  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Unreviewed, rolling out r147383.
     4        http://trac.webkit.org/changeset/147383
     5        https://bugs.webkit.org/show_bug.cgi?id=112369
     6
     7        Speculative rollout because of lots of layout test failure
     8
     9        * html/parser/HTMLDocumentParser.cpp:
     10        (WebCore::HTMLDocumentParser::~HTMLDocumentParser):
     11        (WebCore::HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser):
     12        (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser):
     13        (WebCore::HTMLDocumentParser::pumpPendingSpeculations):
     14        (WebCore::HTMLDocumentParser::insert):
     15        * html/parser/HTMLParserScheduler.cpp:
     16        (WebCore::PumpSession::PumpSession):
     17        * html/parser/HTMLParserScheduler.h:
     18
    1192013-04-02  Eugene Klyuchnikov  <eustas@chromium.org>
    220
  • trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp

    r147383 r147413  
    128128    ASSERT(!m_insertionPreloadScanner);
    129129    ASSERT(!m_haveBackgroundParser);
    130     // FIXME: We should be able to ASSERT(m_speculations.isEmpty()),
    131     // but there are cases where that's not true currently. For example,
    132     // we we're told to stop parsing before we've consumed all the input.
    133130}
    134131
     
    315312void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> chunk)
    316313{
    317     // alert(), runModalDialog, and the JavaScript Debugger all run nested event loops
    318     // which can cause this method to be re-entered. We detect re-entry using
    319     // inPumpSession(), save the chunk as a speculation, and return.
    320     if (isWaitingForScripts() || !m_speculations.isEmpty() || inPumpSession()) {
     314    if (isWaitingForScripts() || !m_speculations.isEmpty()) {
    321315        m_preloader->takeAndPreload(chunk->preloads);
    322316        m_speculations.append(chunk);
     
    328322    RefPtr<HTMLDocumentParser> protect(this);
    329323
     324    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), lineNumber().zeroBasedInt());
     325
    330326    ASSERT(m_speculations.isEmpty());
    331327    chunk->preloads.clear(); // We don't need to preload because we're going to parse immediately.
    332     m_speculations.append(chunk);
    333     pumpPendingSpeculations();
     328    processParsedChunkFromBackgroundParser(chunk);
     329
     330    InspectorInstrumentation::didWriteHTML(cookie, lineNumber().zeroBasedInt());
    334331}
    335332
     
    394391void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk)
    395392{
    396     ASSERT_WITH_SECURITY_IMPLICATION(!inPumpSession());
    397     ASSERT(!isParsingFragment());
    398     ASSERT(!isWaitingForScripts());
    399     ASSERT(!isStopped());
    400393    // ASSERT that this object is both attached to the Document and protected.
    401394    ASSERT(refCount() >= 2);
     
    405398    ASSERT(!m_lastChunkBeforeScript);
    406399
    407     PumpSession session(m_pumpSessionNestingLevel, contextForParsingSession());
    408 
     400    ActiveParserSession session(contextForParsingSession());
    409401    OwnPtr<ParsedChunk> chunk(popChunk);
    410402    OwnPtr<CompactHTMLTokenStream> tokens = chunk->tokens.release();
     
    435427            // we peek to see if this chunk has an EOF and process it anyway.
    436428            if (tokens->last().type() == HTMLToken::EndOfFile) {
    437                 ASSERT(m_speculations.isEmpty()); // There should never be any chunks after the EOF.
     429                ASSERT(m_speculations.isEmpty());
    438430                prepareToStopParsing();
    439431            }
     
    450442        if (it->type() == HTMLToken::EndOfFile) {
    451443            ASSERT(it + 1 == tokens->end()); // The EOF is assumed to be the last token of this bunch.
    452             ASSERT(m_speculations.isEmpty()); // There should never be any chunks after the EOF.
     444            ASSERT(m_speculations.isEmpty());
    453445            prepareToStopParsing();
    454446            break;
     
    472464    ASSERT(!m_token);
    473465    ASSERT(!m_lastChunkBeforeScript);
    474     ASSERT(!isWaitingForScripts());
    475     ASSERT(!isStopped());
    476466
    477467    // FIXME: Pass in current input length.
     
    640630#if ENABLE(THREADED_HTML_PARSER)
    641631    if (!m_tokenizer) {
     632        ASSERT(!inPumpSession());
    642633        ASSERT(m_haveBackgroundParser || wasCreatedByScript());
    643634        m_token = adoptPtr(new HTMLToken);
  • trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp

    r147383 r147413  
    7878
    7979PumpSession::PumpSession(unsigned& nestingLevel, Document* document)
    80     : ActiveParserSession(document)
    81     , NestingLevelIncrementer(nestingLevel)
     80    : NestingLevelIncrementer(nestingLevel)
     81    , ActiveParserSession(document)
    8282    // Setting processedTokens to INT_MAX causes us to check for yields
    8383    // after any token during any parse where yielding is allowed.
  • trunk/Source/WebCore/html/parser/HTMLParserScheduler.h

    r147383 r147413  
    4848};
    4949
    50 // In C++, base classes are destructed from right to left, which means
    51 // ~NestingLevelIncrementer will run before ~ActiveParserSession. This
    52 // is important because ~ActiveParserSession calls Document::decrementActiveParserCount,
    53 // which cares about the pump nesting level of the parser.
    54 class PumpSession : public ActiveParserSession, public NestingLevelIncrementer {
     50class PumpSession : public NestingLevelIncrementer, public ActiveParserSession {
    5551public:
    5652    PumpSession(unsigned& nestingLevel, Document*);
Note: See TracChangeset for help on using the changeset viewer.