Closed
Bug 1415766
Opened 7 years ago
Closed 7 years ago
We never pass anything other than NS_SEEK_SET to MediaCacheStream::Seek()
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
(2 files)
http://searchfox.org/mozilla-central/rev/c99d035f00dd894feff38e4ad28a73fb679c63a6/dom/media/MediaCache.cpp#2424-2439 We don't need the switch case at all.
Assignee | ||
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8926684 -
Flags: review?(bechen)
Attachment #8926685 -
Flags: review?(bechen)
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8926684 [details] Bug 1415766. P1 - we never pass anything other than NS_SEEK_SET to Seek(). https://reviewboard.mozilla.org/r/197926/#review203114 ::: dom/media/MediaCache.cpp:31 (Diff revision 1) > #include "nsIPrincipal.h" > -#include "nsISeekableStream.h" > #include "nsPrintfCString.h" > #include "nsProxyRelease.h" > #include "nsThreadUtils.h" > #include "prio.h" Could we also remove the prio.h?
Attachment #8926684 -
Flags: review?(bechen) → review+
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8926685 [details] Bug 1415766. P2 - move Seek() to private and tighten up some assertions. https://reviewboard.mozilla.org/r/197928/#review203118
Attachment #8926685 -
Flags: review?(bechen) → review+
Assignee | ||
Comment 5•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8926684 [details] Bug 1415766. P1 - we never pass anything other than NS_SEEK_SET to Seek(). https://reviewboard.mozilla.org/r/197926/#review203114 > Could we also remove the prio.h? I will do that in a new bug.
Assignee | ||
Updated•7 years ago
|
Attachment #8926684 -
Flags: review?(gsquelart)
Attachment #8926685 -
Flags: review?(gsquelart)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8926684 [details] Bug 1415766. P1 - we never pass anything other than NS_SEEK_SET to Seek(). https://reviewboard.mozilla.org/r/197926/#review203126 LGTM. Note that this is similar to bug 1374173, which was backed out for intermittent failures! But it was probably because of the other part of that bug, so I think this one should be fine; but please keep an eye on build results. ::: dom/media/MediaCache.cpp:2425 (Diff revision 1) > - default: > - NS_ERROR("Unknown whence"); > return NS_ERROR_FAILURE; > } > - > + int64_t oldOffset = mStreamOffset; > + int64_t newOffset = aOffset; You don't really need `newOffset` anymore, you could just use `aOffset` throughout. ::: dom/media/MediaCache.cpp:2426 (Diff revision 1) > if (!IsOffsetAllowed(newOffset)) { > return NS_ERROR_FAILURE; > } Minor optimization: Move this test&return before taking the monitor.
Attachment #8926684 -
Flags: review?(gsquelart) → review+
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8926685 [details] Bug 1415766. P2 - move Seek() to private and tighten up some assertions. https://reviewboard.mozilla.org/r/197928/#review203132 ::: dom/media/MediaCache.cpp:2421 (Diff revision 1) > MediaCacheStream::Seek(int64_t aOffset) > { > - NS_ASSERTION(!NS_IsMainThread(), "Don't call on main thread"); > + MOZ_ASSERT(!NS_IsMainThread()); > + mMediaCache->GetReentrantMonitor().AssertCurrentThreadIn(); > > - ReentrantMonitorAutoEnter mon(mMediaCache->GetReentrantMonitor()); > + if (mClosed || !IsOffsetAllowed(aOffset)) { As per my comment in the previous patch, the `IsOffsetAllowed` test could be done before taking the monitor. But it's very minor, so totally optional.
Attachment #8926685 -
Flags: review?(gsquelart) → review+
Comment 8•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8926684 [details] Bug 1415766. P1 - we never pass anything other than NS_SEEK_SET to Seek(). https://reviewboard.mozilla.org/r/197926/#review203126 > You don't really need `newOffset` anymore, you could just use `aOffset` throughout. I see you've done that in the next patch, so nevermind. :-)
Blocks: 1374173
Assignee | ||
Comment 9•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8926685 [details] Bug 1415766. P2 - move Seek() to private and tighten up some assertions. https://reviewboard.mozilla.org/r/197928/#review203132 > As per my comment in the previous patch, the `IsOffsetAllowed` test could be done before taking the monitor. But it's very minor, so totally optional. #2419 now asserts the monitor is already taken without taking it.
Assignee | ||
Comment 10•7 years ago
|
||
Thanks for the reviews!
Comment 11•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8926685 [details] Bug 1415766. P2 - move Seek() to private and tighten up some assertions. https://reviewboard.mozilla.org/r/197928/#review203132 > #2419 now asserts the monitor is already taken without taking it. Oops, didn't notice, sorry. All good, then!
Comment hidden (mozreview-request) |
Comment 13•7 years ago
|
||
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/753f3591930d P1 - we never pass anything other than NS_SEEK_SET to Seek(). r=bechen,gerald https://hg.mozilla.org/integration/autoland/rev/b12b1f6beb49 P2 - move Seek() to private and tighten up some assertions. r=bechen,gerald
Comment 14•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/753f3591930d https://hg.mozilla.org/mozilla-central/rev/b12b1f6beb49
Status: NEW → RESOLVED
Closed: 7 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
•