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
: WebKit
HTML DOM
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
:
: 23175
  Show dependency treegraph
 
Reported: 2009-01-08 16:25 PST by
Modified: 2009-01-09 01:42 PST (History)


Attachments
Patch for bug. (4.27 KB, patch)
2009-01-08 16:58 PST, David Levin
no flags Review Patch | 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 Review Patch | 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+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 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 From 2009-01-08 16:58:50 PST -------
Created an attachment (id=26548) [details]
Patch for bug.
------- Comment #2 From 2009-01-09 01:32:40 PST -------
Created an attachment (id=26561) [details]
Changed to a static create method (instead of using new directly) and added a comment.
------- Comment #3 From 2009-01-09 01:36:08 PST -------
Created an attachment (id=26562) [details]
Diff form last version of the patch: I noticed a bad indentation in one place and fixed it.
------- Comment #4 From 2009-01-09 01:41:03 PST -------
(From update of attachment 26562 [details])
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 From 2009-01-09 01:42:42 PST -------
Committed revision 39740.