Closed Bug 1404771 Opened 8 years ago Closed 8 years ago

Some MediaCache code cleanup

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(3 files)

No description provided.
Assignee: nobody → jwwang
Blocks: 1382978
Priority: -- → P3
Attachment #8914153 - Flags: review?(gsquelart)
Attachment #8914154 - Flags: review?(gsquelart)
Attachment #8914155 - Flags: review?(gsquelart)
Attachment #8914153 - Flags: review?(gsquelart) → review+
Comment on attachment 8914154 [details] Bug 1404771. P2 - always access mThrottleReadahead within the lock. https://reviewboard.mozilla.org/r/185474/#review190390
Attachment #8914154 - Flags: review?(gsquelart) → review+
Comment on attachment 8914155 [details] Bug 1404771. P3 - constify some members and fix comments. https://reviewboard.mozilla.org/r/185476/#review190396 ::: dom/media/MediaCache.h:465 (Diff revision 1) > // than the priority of the data already in the cache > bool mCacheSuspended; > // True if the channel ended and we haven't seeked it again. > bool mChannelEnded; > > // The following fields are protected by the cache's monitor can can be written While you're here, you could fix this comment: I think the first 'can' should be 'and'. ::: dom/media/MediaCache.h:509 (Diff revision 1) > - UniquePtr<uint8_t[]> mPartialBlockBuffer = MakeUnique<uint8_t[]>(BLOCK_SIZE); > + // This partial buffer should always be read/write within the cache's monitor. > + const UniquePtr<uint8_t[]> mPartialBlockBuffer = > + MakeUnique<uint8_t[]>(BLOCK_SIZE); Noticed while reviewing this: This field and a few others seem to be accessed without lock in MediaCacheStream::SizeOfExcludingThis, is that acceptable?
Attachment #8914155 - Flags: review?(gsquelart) → review+
Comment on attachment 8914155 [details] Bug 1404771. P3 - constify some members and fix comments. https://reviewboard.mozilla.org/r/185476/#review190396 > Noticed while reviewing this: This field and a few others seem to be accessed without lock in MediaCacheStream::SizeOfExcludingThis, is that acceptable? mPartialBlockBuffer.get() is immutable after construction so it can be safely accessed without any lock. However, the buffer pointed by mPartialBlockBuffer.get() must be protected by the lock.
Thanks for the review!
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/edb79608b20b P1 - fix the comment of mStreamLength. r=gerald https://hg.mozilla.org/integration/autoland/rev/08258a04521e P2 - always access mThrottleReadahead within the lock. r=gerald https://hg.mozilla.org/integration/autoland/rev/7c06e30b1373 P3 - constify some members and fix comments. r=gerald
Blocks: 1428688
No longer blocks: 1428688
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: