Closed
Bug 1404771
Opened 8 years ago
Closed 8 years ago
Some MediaCache code cleanup
Categories
(Core :: Audio/Video: Playback, enhancement, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla58
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
References
Details
Attachments
(3 files)
No description provided.
| Assignee | ||
Updated•8 years ago
|
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8914153 -
Flags: review?(gsquelart)
Attachment #8914154 -
Flags: review?(gsquelart)
Attachment #8914155 -
Flags: review?(gsquelart)
Comment 4•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8914153 [details]
Bug 1404771. P1 - fix the comment of mStreamLength.
https://reviewboard.mozilla.org/r/185472/#review190388
Attachment #8914153 -
Flags: review?(gsquelart) → review+
Comment 5•8 years ago
|
||
| mozreview-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 6•8 years ago
|
||
| mozreview-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 hidden (mozreview-request) |
| Assignee | ||
Comment 8•8 years ago
|
||
| mozreview-review-reply | ||
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.
| Assignee | ||
Comment 9•8 years ago
|
||
Thanks for the review!
Comment 10•8 years ago
|
||
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
Comment 11•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/edb79608b20b
https://hg.mozilla.org/mozilla-central/rev/08258a04521e
https://hg.mozilla.org/mozilla-central/rev/7c06e30b1373
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•