Title: [147413] trunk/Source/WebCore
Revision
147413
Author
[email protected]
Date
2013-04-02 03:21:01 -0700 (Tue, 02 Apr 2013)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147412 => 147413)


--- trunk/Source/WebCore/ChangeLog	2013-04-02 09:52:29 UTC (rev 147412)
+++ trunk/Source/WebCore/ChangeLog	2013-04-02 10:21:01 UTC (rev 147413)
@@ -1,3 +1,21 @@
+2013-04-02  Shinya Kawanaka  <[email protected]>
+
+        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:
+
 2013-04-02  Eugene Klyuchnikov  <[email protected]>
 
         Web Inspector: [HeapProfiler] Table rows do not appear when resizing.

Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (147412 => 147413)


--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-04-02 09:52:29 UTC (rev 147412)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-04-02 10:21:01 UTC (rev 147413)
@@ -127,9 +127,6 @@
     ASSERT(!m_preloadScanner);
     ASSERT(!m_insertionPreloadScanner);
     ASSERT(!m_haveBackgroundParser);
-    // FIXME: We should be able to ASSERT(m_speculations.isEmpty()),
-    // but there are cases where that's not true currently. For example,
-    // we we're told to stop parsing before we've consumed all the input.
 }
 
 #if ENABLE(THREADED_HTML_PARSER)
@@ -314,10 +311,7 @@
 
 void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> chunk)
 {
-    // alert(), runModalDialog, and the _javascript_ Debugger all run nested event loops
-    // which can cause this method to be re-entered. We detect re-entry using
-    // inPumpSession(), save the chunk as a speculation, and return.
-    if (isWaitingForScripts() || !m_speculations.isEmpty() || inPumpSession()) {
+    if (isWaitingForScripts() || !m_speculations.isEmpty()) {
         m_preloader->takeAndPreload(chunk->preloads);
         m_speculations.append(chunk);
         return;
@@ -327,10 +321,13 @@
     // but we need to ensure it isn't deleted yet.
     RefPtr<HTMLDocumentParser> protect(this);
 
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), lineNumber().zeroBasedInt());
+
     ASSERT(m_speculations.isEmpty());
     chunk->preloads.clear(); // We don't need to preload because we're going to parse immediately.
-    m_speculations.append(chunk);
-    pumpPendingSpeculations();
+    processParsedChunkFromBackgroundParser(chunk);
+
+    InspectorInstrumentation::didWriteHTML(cookie, lineNumber().zeroBasedInt());
 }
 
 void HTMLDocumentParser::validateSpeculations(PassOwnPtr<ParsedChunk> chunk)
@@ -393,10 +390,6 @@
 
 void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!inPumpSession());
-    ASSERT(!isParsingFragment());
-    ASSERT(!isWaitingForScripts());
-    ASSERT(!isStopped());
     // ASSERT that this object is both attached to the Document and protected.
     ASSERT(refCount() >= 2);
     ASSERT(shouldUseThreading());
@@ -404,8 +397,7 @@
     ASSERT(!m_token);
     ASSERT(!m_lastChunkBeforeScript);
 
-    PumpSession session(m_pumpSessionNestingLevel, contextForParsingSession());
-
+    ActiveParserSession session(contextForParsingSession());
     OwnPtr<ParsedChunk> chunk(popChunk);
     OwnPtr<CompactHTMLTokenStream> tokens = chunk->tokens.release();
 
@@ -434,7 +426,7 @@
             // To match main-thread parser behavior (which never checks locationChangePending on the EOF path)
             // we peek to see if this chunk has an EOF and process it anyway.
             if (tokens->last().type() == HTMLToken::EndOfFile) {
-                ASSERT(m_speculations.isEmpty()); // There should never be any chunks after the EOF.
+                ASSERT(m_speculations.isEmpty());
                 prepareToStopParsing();
             }
             break;
@@ -449,7 +441,7 @@
 
         if (it->type() == HTMLToken::EndOfFile) {
             ASSERT(it + 1 == tokens->end()); // The EOF is assumed to be the last token of this bunch.
-            ASSERT(m_speculations.isEmpty()); // There should never be any chunks after the EOF.
+            ASSERT(m_speculations.isEmpty());
             prepareToStopParsing();
             break;
         }
@@ -471,8 +463,6 @@
     ASSERT(!m_tokenizer);
     ASSERT(!m_token);
     ASSERT(!m_lastChunkBeforeScript);
-    ASSERT(!isWaitingForScripts());
-    ASSERT(!isStopped());
 
     // FIXME: Pass in current input length.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), lineNumber().zeroBasedInt());
@@ -639,6 +629,7 @@
 
 #if ENABLE(THREADED_HTML_PARSER)
     if (!m_tokenizer) {
+        ASSERT(!inPumpSession());
         ASSERT(m_haveBackgroundParser || wasCreatedByScript());
         m_token = adoptPtr(new HTMLToken);
         m_tokenizer = HTMLTokenizer::create(m_options);

Modified: trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp (147412 => 147413)


--- trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp	2013-04-02 09:52:29 UTC (rev 147412)
+++ trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp	2013-04-02 10:21:01 UTC (rev 147413)
@@ -77,8 +77,8 @@
 }
 
 PumpSession::PumpSession(unsigned& nestingLevel, Document* document)
-    : ActiveParserSession(document)
-    , NestingLevelIncrementer(nestingLevel)
+    : NestingLevelIncrementer(nestingLevel)
+    , ActiveParserSession(document)
     // Setting processedTokens to INT_MAX causes us to check for yields
     // after any token during any parse where yielding is allowed.
     // At that time we'll initialize startTime.

Modified: trunk/Source/WebCore/html/parser/HTMLParserScheduler.h (147412 => 147413)


--- trunk/Source/WebCore/html/parser/HTMLParserScheduler.h	2013-04-02 09:52:29 UTC (rev 147412)
+++ trunk/Source/WebCore/html/parser/HTMLParserScheduler.h	2013-04-02 10:21:01 UTC (rev 147413)
@@ -47,11 +47,7 @@
     RefPtr<Document> m_document;
 };
 
-// In C++, base classes are destructed from right to left, which means
-// ~NestingLevelIncrementer will run before ~ActiveParserSession. This
-// is important because ~ActiveParserSession calls Document::decrementActiveParserCount,
-// which cares about the pump nesting level of the parser.
-class PumpSession : public ActiveParserSession, public NestingLevelIncrementer {
+class PumpSession : public NestingLevelIncrementer, public ActiveParserSession {
 public:
     PumpSession(unsigned& nestingLevel, Document*);
     ~PumpSession();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to