Bug 107190

Summary: Use WeakPtrs to communicate between the HTMLDocumentParser and the BackgroundHTMLParser
Product: WebKit Reporter: Adam Barth <abarth>
Component: New BugsAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, eric, ojan.autocc, tonyg, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 107637    
Bug Blocks: 106127    
Attachments:
Description Flags
Patch
none
Patch none

Adam Barth
Reported 2013-01-17 15:22:33 PST
Use WeakPtrs to communicate between the HTMLDocumentParser and the BackgroundHTMLParser
Attachments
Patch (21.37 KB, patch)
2013-01-17 15:29 PST, Adam Barth
no flags
Patch (15.79 KB, patch)
2013-02-08 11:16 PST, Adam Barth
no flags
Adam Barth
Comment 1 2013-01-17 15:29:14 PST
Eric Seidel (no email)
Comment 2 2013-01-17 19:48:38 PST
Comment on attachment 183299 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=183299&action=review > Source/WebCore/html/parser/BackgroundHTMLParser.cpp:88 > +void BackgroundHTMLParser::stop() > +{ > + delete this; > +} Shouldn't it clear itself from its weak ptr factry?
Adam Barth
Comment 3 2013-01-17 21:04:24 PST
That happens automatically. The only reason we do it manually in HTMLDocumentParser is because we want to cancel all incoming messages before being destroyed.
Eric Seidel (no email)
Comment 4 2013-01-22 18:43:47 PST
Comment on attachment 183299 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=183299&action=review > Source/WebCore/html/parser/BackgroundHTMLParser.h:45 > + struct Config { You mentioned this isn't needed, maybe we should add a FIXME.
Adam Barth
Comment 5 2013-01-22 21:52:32 PST
I can break this patch into smaller pieces if that would be helpful. Using WeakPtrs just for the background -> foreground communication would be a much smaller patch.
Eric Seidel (no email)
Comment 6 2013-01-22 22:05:58 PST
That would help me, yes.
Adam Barth
Comment 7 2013-02-08 11:16:16 PST
Eric Seidel (no email)
Comment 8 2013-02-08 11:23:51 PST
Comment on attachment 187339 [details] Patch This is so much better. Thank you.
Adam Barth
Comment 9 2013-02-08 11:32:21 PST
Comment on attachment 187339 [details] Patch Clearing flags on attachment: 187339 Committed r142305: <http://trac.webkit.org/changeset/142305>
Adam Barth
Comment 10 2013-02-08 11:32:25 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.