Title: [139954] trunk/Source/WebCore
Revision
139954
Author
[email protected]
Date
2013-01-16 19:42:09 -0800 (Wed, 16 Jan 2013)

Log Message

Address tonyg's feedback on BackgroundHTMLParser
https://bugs.webkit.org/show_bug.cgi?id=107086

Reviewed by Tony Gentilcore.

As requested in https://bugs.webkit.org/show_bug.cgi?id=107083#c5

* html/parser/BackgroundHTMLParser.cpp:
(WebCore::BackgroundHTMLParser::pumpTokenizer):
(TokenDelivery):
(WebCore::TokenDelivery::TokenDelivery):
(WebCore::TokenDelivery::execute):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139953 => 139954)


--- trunk/Source/WebCore/ChangeLog	2013-01-17 03:36:48 UTC (rev 139953)
+++ trunk/Source/WebCore/ChangeLog	2013-01-17 03:42:09 UTC (rev 139954)
@@ -1,3 +1,18 @@
+2013-01-16  Adam Barth  <[email protected]>
+
+        Address tonyg's feedback on BackgroundHTMLParser
+        https://bugs.webkit.org/show_bug.cgi?id=107086
+
+        Reviewed by Tony Gentilcore.
+
+        As requested in https://bugs.webkit.org/show_bug.cgi?id=107083#c5
+
+        * html/parser/BackgroundHTMLParser.cpp:
+        (WebCore::BackgroundHTMLParser::pumpTokenizer):
+        (TokenDelivery):
+        (WebCore::TokenDelivery::TokenDelivery):
+        (WebCore::TokenDelivery::execute):
+
 2013-01-16  Tony Gentilcore  <[email protected]>
 
         Introduce a method to build the tree from a CompactHTMLToken

Modified: trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp (139953 => 139954)


--- trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp	2013-01-17 03:36:48 UTC (rev 139953)
+++ trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp	2013-01-17 03:42:09 UTC (rev 139954)
@@ -103,6 +103,11 @@
     if (m_isPausedWaitingForScripts)
         return;
 
+    // It's unclear whether we want to use AtomicStrings on the background
+    // thread. We will likely eventually use libdispatch to schedule parsing
+    // in a separate sequenced queue for each HTMLDocumentParser instance.
+    // Once we do that, the code below will be unsafe because libdispatch
+    // might schedule us on many different threads.
     DEFINE_STATIC_LOCAL(AtomicString, iframeTag, ("iframe", AtomicString::ConstructFromLiteral));
     DEFINE_STATIC_LOCAL(AtomicString, mathTag, ("math", AtomicString::ConstructFromLiteral));
     DEFINE_STATIC_LOCAL(AtomicString, noembedTag, ("noembed", AtomicString::ConstructFromLiteral));
@@ -162,7 +167,10 @@
 }
 
 class TokenDelivery {
+    WTF_MAKE_NONCOPYABLE(TokenDelivery);
 public:
+    TokenDelivery() { }
+
     ParserIdentifier identifier;
     Vector<CompactHTMLToken> tokens;
 
@@ -172,6 +180,9 @@
         HTMLDocumentParser* parser = parserMap().mainThreadParsers().get(delivery->identifier);
         if (parser)
             parser->didReceiveTokensFromBackgroundParser(delivery->tokens);
+        // FIXME: Ideally we wouldn't need to call delete manually. Instead
+        // we would like an API where the message queue owns the tasks and
+        // takes care of deleting them.
         delete delivery;
     }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to