Closed Bug 1097740 Opened 10 years ago Closed 10 years ago

use NS_INLINE_DECL_REFCOUNTING for Fake_MediaStreamTrack in FakeMediaStreams.h

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file, 1 obsolete file)

There are a select few places where RefCounted should be used.  This is not one
of them.
Note that we already use variants of NS_INLINE_DECL*REFCOUNTING elsewhere in
this file.  This change makes us more consistent in addition to other benefits.
Attachment #8521476 - Flags: review?(rjesup)
Attachment #8521476 - Flags: review?(rjesup) → review+
(In reply to Wes Kocher (:KWierso) from comment #2)
> I backed this out in
> https://hg.mozilla.org/integration/mozilla-inbound/rev/8dbb9eef253b for
> cppunit test orange:
> https://treeherder.mozilla.org/ui/logviewer.
> html#?job_id=3827385&repo=mozilla-inbound

Yeah, I have no idea why swapping out the refcounting here would cause those sorts of crashes.  Ideally it'll reproduce on my machine, though...
Flags: needinfo?(nfroyd)
Ah, the real bug is this:

13:05:27 INFO - Hit MOZ_CRASH(Fake_MediaStreamTrack not thread-safe) at /builds/slave/m-in-lx-d-00000000000000000000/build/media/webrtc/signaling/test/FakeMediaStreams.h:221

The MFBT refcounting bits weren't checking for thread ownership, whereas the XPCOM ones were.  Maybe this cleanup will even fix some intermittent crashes...?
As explained in comment 4, it looks like we ought to have been using threadsafe
refcounting with this class...
Attachment #8521476 - Attachment is obsolete: true
Attachment #8522268 - Flags: review?(rjesup)
Comment on attachment 8522268 [details] [diff] [review]
use NS_INLINE_DECL_THREADSAFE_REFCOUNTING for Fake_MediaStreamTrack in FakeMediaStreams.h

Review of attachment 8522268 [details] [diff] [review]:
-----------------------------------------------------------------

Yes, I imagine it does have to be threadsafe (and perhaps the old RefCounted<> wasn't doing thread checks).
Attachment #8522268 - Flags: review?(rjesup) → review+
https://hg.mozilla.org/mozilla-central/rev/ca998f9e1b71
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: