Bug 23199 - WorkerThread shouldn't deref strings on the main thread that it used on the worker thread.
: WorkerThread shouldn't deref strings on the main thread that it used on the w...
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: HTML DOM
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: David Levin
:
Depends on:
Blocks: 23175
  Show dependency treegraph
 
Reported: 2009-01-08 16:25 PST by David Levin
Modified: 2009-01-09 01:42 PST (History)
1 user (show)

See Also:


Attachments
Patch for bug. (4.27 KB, patch)
2009-01-08 16:58 PST, David Levin
no flags Details | Formatted Diff | Diff
Changed to a static create method (instead of using new directly) and added a comment. (4.90 KB, patch)
2009-01-09 01:32 PST, David Levin
no flags Details | Formatted Diff | Diff
Diff form last version of the patch: I noticed a bad indentation in one place and fixed it. (4.91 KB, patch)
2009-01-09 01:36 PST, David Levin
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2009-01-08 16:25:29 PST
Currently, WorkerThread::WorkerThread copies some Strings and a KURL for use on the worker thread.

After passing them off to other objects in side of the worker thread (where they get ref/deref'ed), its destructor runs on the main thread and does a deref on these string there.  This should mostly work, but there is a potential for some subtle race conditions to occur, so it would be good to clean them up on the WorkerThread.
Comment 1 David Levin 2009-01-08 16:58:50 PST
Created attachment 26548 [details]
Patch for bug.
Comment 2 David Levin 2009-01-09 01:32:40 PST
Created attachment 26561 [details]
Changed to a static create method (instead of using new directly) and added a comment.
Comment 3 David Levin 2009-01-09 01:36:08 PST
Created attachment 26562 [details]
Diff form last version of the patch: I noticed a bad indentation in one place and fixed it.
Comment 4 Alexey Proskuryakov 2009-01-09 01:41:03 PST
Comment on attachment 26562 [details]
Diff form last version of the patch: I noticed a bad indentation in one place and fixed it.

r=me

A general comment, not for this patch: the prevalent style is to have "using namespace std", and avoid explicit namespace qualifiers.
Comment 5 Alexey Proskuryakov 2009-01-09 01:42:42 PST
Committed revision 39740.