Changeset 147413 in webkit
- Timestamp:
- Apr 2, 2013 3:21:01 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147412 r147413 1 2013-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 1 19 2013-04-02 Eugene Klyuchnikov <eustas@chromium.org> 2 20 -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
r147383 r147413 128 128 ASSERT(!m_insertionPreloadScanner); 129 129 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.133 130 } 134 131 … … 315 312 void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> chunk) 316 313 { 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()) { 321 315 m_preloader->takeAndPreload(chunk->preloads); 322 316 m_speculations.append(chunk); … … 328 322 RefPtr<HTMLDocumentParser> protect(this); 329 323 324 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), lineNumber().zeroBasedInt()); 325 330 326 ASSERT(m_speculations.isEmpty()); 331 327 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()); 334 331 } 335 332 … … 394 391 void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk) 395 392 { 396 ASSERT_WITH_SECURITY_IMPLICATION(!inPumpSession());397 ASSERT(!isParsingFragment());398 ASSERT(!isWaitingForScripts());399 ASSERT(!isStopped());400 393 // ASSERT that this object is both attached to the Document and protected. 401 394 ASSERT(refCount() >= 2); … … 405 398 ASSERT(!m_lastChunkBeforeScript); 406 399 407 PumpSession session(m_pumpSessionNestingLevel, contextForParsingSession()); 408 400 ActiveParserSession session(contextForParsingSession()); 409 401 OwnPtr<ParsedChunk> chunk(popChunk); 410 402 OwnPtr<CompactHTMLTokenStream> tokens = chunk->tokens.release(); … … 435 427 // we peek to see if this chunk has an EOF and process it anyway. 436 428 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()); 438 430 prepareToStopParsing(); 439 431 } … … 450 442 if (it->type() == HTMLToken::EndOfFile) { 451 443 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()); 453 445 prepareToStopParsing(); 454 446 break; … … 472 464 ASSERT(!m_token); 473 465 ASSERT(!m_lastChunkBeforeScript); 474 ASSERT(!isWaitingForScripts());475 ASSERT(!isStopped());476 466 477 467 // FIXME: Pass in current input length. … … 640 630 #if ENABLE(THREADED_HTML_PARSER) 641 631 if (!m_tokenizer) { 632 ASSERT(!inPumpSession()); 642 633 ASSERT(m_haveBackgroundParser || wasCreatedByScript()); 643 634 m_token = adoptPtr(new HTMLToken); -
trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp
r147383 r147413 78 78 79 79 PumpSession::PumpSession(unsigned& nestingLevel, Document* document) 80 : ActiveParserSession(document)81 , NestingLevelIncrementer(nestingLevel)80 : NestingLevelIncrementer(nestingLevel) 81 , ActiveParserSession(document) 82 82 // Setting processedTokens to INT_MAX causes us to check for yields 83 83 // after any token during any parse where yielding is allowed. -
trunk/Source/WebCore/html/parser/HTMLParserScheduler.h
r147383 r147413 48 48 }; 49 49 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 { 50 class PumpSession : public NestingLevelIncrementer, public ActiveParserSession { 55 51 public: 56 52 PumpSession(unsigned& nestingLevel, Document*);
Note: See TracChangeset
for help on using the changeset viewer.