Title: [142648] trunk/Source/WebCore
Revision
142648
Author
[email protected]
Date
2013-02-12 11:39:38 -0800 (Tue, 12 Feb 2013)

Log Message

BackgroundHTMLParser::resumeFrom should take a struct
https://bugs.webkit.org/show_bug.cgi?id=109598

Reviewed by Eric Seidel.

This patch is purely a syntatic change that paves the way for fixing
the partial-entity document.write tests. To fix those tests, we'll need
to pass more information to resumeFrom, but we're hitting the argument
limits in Functional.h. Rather than adding yet more arguments, this
patch moves to a single argument that's a struct.

* html/parser/BackgroundHTMLParser.cpp:
(WebCore::BackgroundHTMLParser::resumeFrom):
* html/parser/BackgroundHTMLParser.h:
(Checkpoint):
(BackgroundHTMLParser):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didFailSpeculation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (142647 => 142648)


--- trunk/Source/WebCore/ChangeLog	2013-02-12 19:35:01 UTC (rev 142647)
+++ trunk/Source/WebCore/ChangeLog	2013-02-12 19:39:38 UTC (rev 142648)
@@ -1,3 +1,24 @@
+2013-02-12  Adam Barth  <[email protected]>
+
+        BackgroundHTMLParser::resumeFrom should take a struct
+        https://bugs.webkit.org/show_bug.cgi?id=109598
+
+        Reviewed by Eric Seidel.
+
+        This patch is purely a syntatic change that paves the way for fixing
+        the partial-entity document.write tests. To fix those tests, we'll need
+        to pass more information to resumeFrom, but we're hitting the argument
+        limits in Functional.h. Rather than adding yet more arguments, this
+        patch moves to a single argument that's a struct.
+
+        * html/parser/BackgroundHTMLParser.cpp:
+        (WebCore::BackgroundHTMLParser::resumeFrom):
+        * html/parser/BackgroundHTMLParser.h:
+        (Checkpoint):
+        (BackgroundHTMLParser):
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::didFailSpeculation):
+
 2013-02-12  Elliott Sprehn  <[email protected]>
 
         rootRenderer in FrameView is really RenderView

Modified: trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp (142647 => 142648)


--- trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp	2013-02-12 19:35:01 UTC (rev 142647)
+++ trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp	2013-02-12 19:39:38 UTC (rev 142648)
@@ -76,12 +76,12 @@
     pumpTokenizer();
 }
 
-void BackgroundHTMLParser::resumeFrom(const WeakPtr<HTMLDocumentParser>& parser, PassOwnPtr<HTMLToken> token, PassOwnPtr<HTMLTokenizer> tokenizer, HTMLInputCheckpoint checkpoint)
+void BackgroundHTMLParser::resumeFrom(PassOwnPtr<Checkpoint> checkpoint)
 {
-    m_parser = parser;
-    m_token = token;
-    m_tokenizer = tokenizer;
-    m_input.rewindTo(checkpoint);
+    m_parser = checkpoint->parser;
+    m_token = checkpoint->token.release();
+    m_tokenizer = checkpoint->tokenizer.release();
+    m_input.rewindTo(checkpoint->inputCheckpoint);
     pumpTokenizer();
 }
 

Modified: trunk/Source/WebCore/html/parser/BackgroundHTMLParser.h (142647 => 142648)


--- trunk/Source/WebCore/html/parser/BackgroundHTMLParser.h	2013-02-12 19:35:01 UTC (rev 142647)
+++ trunk/Source/WebCore/html/parser/BackgroundHTMLParser.h	2013-02-12 19:39:38 UTC (rev 142648)
@@ -53,8 +53,15 @@
         // Caller must free by calling stop().
     }
 
+    struct Checkpoint {
+        WeakPtr<HTMLDocumentParser> parser;
+        OwnPtr<HTMLToken> token;
+        OwnPtr<HTMLTokenizer> tokenizer;
+        HTMLInputCheckpoint inputCheckpoint;
+    };
+
     void append(const String&);
-    void resumeFrom(const WeakPtr<HTMLDocumentParser>&, PassOwnPtr<HTMLToken>, PassOwnPtr<HTMLTokenizer>, HTMLInputCheckpoint);
+    void resumeFrom(PassOwnPtr<Checkpoint>);
     void finish();
     void stop();
 

Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (142647 => 142648)


--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-02-12 19:35:01 UTC (rev 142647)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-02-12 19:39:38 UTC (rev 142648)
@@ -307,8 +307,13 @@
     m_weakFactory.revokeAll();
     m_speculations.clear();
 
-    HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::resumeFrom,
-        m_backgroundParser, m_weakFactory.createWeakPtr(), token, tokenizer, m_currentChunk->checkpoint));
+    OwnPtr<BackgroundHTMLParser::Checkpoint> checkpoint = adoptPtr(new BackgroundHTMLParser::Checkpoint);
+    checkpoint->parser = m_weakFactory.createWeakPtr();
+    checkpoint->token = token;
+    checkpoint->tokenizer = tokenizer;
+    checkpoint->inputCheckpoint = m_currentChunk->checkpoint;
+
+    HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::resumeFrom, m_backgroundParser, checkpoint.release()));
 }
 
 void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> chunk)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to