Closed Bug 1190472 Opened 4 years ago Closed 4 years ago

MediaRawDataQueue::Push/PushFront should take && arguments to reduce refcounting

Categories

(Core :: Audio/Video, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ayg, Assigned: froydnj)

References

Details

Attachments

(3 files)

(Nathan Froyd [:froydnj][:nfroyd] from bug 1179451 comment #32)
> I wonder if these PushFront methods should take && arguments as well or
> instead of pointer arguments, just to avoid unnecessary reference-counting. 
> File a followup bug?
I have patches for this, I'll post them tomorrow.
Assignee: nobody → nfroyd
OK, so "tomorrow" turned into "two weeks", but this is not exactly
high-priority stuff.

Sometimes when we push onto the queue, we don't need to hold a reference
afterwards.  In that case, we can pass the reference in and avoid
unnecessary reference counting.
Attachment #8675747 - Flags: review?(kinetik)
We don't call it, and it's not particularly efficient anyway.
Attachment #8675748 - Flags: review?(kinetik)
In the one place we push a MediaRawDataQueue onto a MediaRawDataQueue,
we don't use the pushee aftewards.  It's more efficient to indicate that
by using Move(), and we can then save on reference-counting things
needlessly.
Attachment #8675749 - Flags: review?(kinetik)
Attachment #8675747 - Flags: review?(kinetik) → review+
Attachment #8675748 - Flags: review?(kinetik) → review+
Attachment #8675749 - Flags: review?(kinetik) → review+
Depends on: 1276572
Part3 incorrectly pushed to the wrong end of the queue. this broke webm playback whenever this code was called.
(In reply to Jean-Yves Avenard [:jya] from comment #7)
> Part3 incorrectly pushed to the wrong end of the queue. this broke webm
> playback whenever this code was called.

Doh.  Sorry about that. :(
You need to log in before you can comment on or make changes to this bug.