Closed Bug 937152 Opened 12 years ago Closed 12 years ago

XPCWrappedJS::mMainThread and mMainThreadOnly are always true

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28
Tracking Status
firefox27 --- fixed
firefox28 --- fixed
firefox-esr24 --- fixed
b2g-v1.2 --- fixed
b2g-v1.3 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Thanks to the work to make XPCWrappedJS only used on the main thread, mMainThread and mMainThreadOnly are always true. We can take advantage of that to simplify some code. I've been touching this code recently, and having this old gunk around is annoying.
I wrote some patches last year to remove all the threading goop, but got blocked on the XPCWrappedJS Stuff. I'm going to dupe this to the older bug - if you want to write those patches, by all means please do so. I promise speedy reviews. :-)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
(unless you had something of more limited scope in mind, in which case feel free to re-open this and mark it as a dep of the other bug)
Yes, this is just a limited thing. Better to incrementally improve the state than to wait on some uber patch. ;)
Blocks: 766889
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Attachment #830225 - Flags: review?(bobbyholley+bmo)
Comment on attachment 830225 [details] [diff] [review] remove the flags and simplify some code Well, I should actually test this first... The constructor for XPCWJS does an AddRef, so it must always be constructed on the main thread, so these flags are (I think) always going to be true. I guess technically something where root is null could have it be false. I also replaced a few instances of NS_IsMainThread() with true in functions where we check and crash at the start of the function.
Attachment #830225 - Flags: review?(bobbyholley+bmo)
mMainThreadOnly may not evaluate to true, but under the assumption that the code I am removing is only executed on the main thread (which is enforced by the CRASH guards), then it will end up behaving the same either way. I should still test this...
Status: REOPENED → ASSIGNED
Comment on attachment 830225 [details] [diff] [review] remove the flags and simplify some code This can at least run mochitests for 10 minutes, so it is probably okay.
Attachment #830225 - Flags: review?(bobbyholley+bmo)
Attachment #830225 - Flags: review?(bobbyholley+bmo) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Blocks: 950909
Flags: in-testsuite?
Flags: in-testsuite? → in-testsuite-
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: