RESOLVED FIXED 107762
HTMLDocumentParser should hold the HTMLToken using an OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=107762
Summary HTMLDocumentParser should hold the HTMLToken using an OwnPtr
Adam Barth
Reported 2013-01-23 17:03:53 PST
HTMLDocumentParser should hold the HTMLToken using an OwnPtr
Attachments
Patch (10.41 KB, patch)
2013-01-23 17:04 PST, Adam Barth
no flags
Patch for landing (10.60 KB, patch)
2013-01-28 23:41 PST, Adam Barth
no flags
Adam Barth
Comment 1 2013-01-23 17:04:38 PST
Eric Seidel (no email)
Comment 2 2013-01-23 17:10:03 PST
Comment on attachment 184358 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184358&action=review This ends up being one more malloc for innerHTML. I'm not sure if we'll end up noticing for perf or not. > Source/WebCore/html/parser/HTMLDocumentParser.cpp:341 > if (!isParsingFragment()) We could just grab a const reference to the token at the top of this loop. The token being able to change is a background-parser thing. in your setToken() method that you write you should probably ASSERT that we're not in the middle of a parsing session.
Adam Barth
Comment 3 2013-01-28 23:40:48 PST
I just added an inline helper function to make the code more readable.
Adam Barth
Comment 4 2013-01-28 23:41:02 PST
Created attachment 185174 [details] Patch for landing
WebKit Review Bot
Comment 5 2013-01-29 00:03:12 PST
Comment on attachment 185174 [details] Patch for landing Clearing flags on attachment: 185174 Committed r141070: <http://trac.webkit.org/changeset/141070>
WebKit Review Bot
Comment 6 2013-01-29 00:03:15 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7 2013-01-29 09:54:37 PST
Comment on attachment 185174 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=185174&action=review > Source/WebCore/html/parser/BackgroundHTMLParser.cpp:157 > + while (m_tokenizer->nextToken(m_input, *m_token.get())) { Should not need the get() call here, because the * operator should work on an OwnPtr. > Source/WebCore/html/parser/HTMLDocumentParser.h:157 > + HTMLToken& token() { return *m_token.get(); } Ditto.
Adam Barth
Comment 8 2013-01-29 12:48:46 PST
Oh, I didn't know that. Thanks!
Note You need to log in before you can comment on or make changes to this bug.