Closed
Bug 1415090
Opened 7 years ago
Closed 7 years ago
Move "reopen on error" off the main thread
Categories
(Core :: Audio/Video: Playback, enhancement, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: jwwang, Assigned: jwwang)
References
Details
Attachments
(5 files)
(deleted),
text/x-review-board-request
|
bechen
:
review+
mozbugz
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
bechen
:
review+
mozbugz
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
bechen
:
review+
mozbugz
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
bechen
:
review+
mozbugz
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
bechen
:
review+
mozbugz
:
review+
|
Details |
http://searchfox.org/mozilla-central/rev/7e090b227f7a0ec44d4ded604823d48823158c51/dom/media/ChannelMediaResource.cpp#387-396
Calling GetLength() and GetOffset() will need to acquire the cache lock and might block the main thread. We will move the code to the owner thread of MediaCache so we won't block the main thread.
Assignee | ||
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8929325 -
Flags: review?(bechen)
Attachment #8929326 -
Flags: review?(bechen)
Attachment #8929327 -
Flags: review?(bechen)
Attachment #8929328 -
Flags: review?(bechen)
Attachment #8929329 -
Flags: review?(bechen)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8929325 [details]
Bug 1415090. P1 - always move the channel back to the foreground when OnStopRequest() is fired.
https://reviewboard.mozilla.org/r/200642/#review205826
Attachment #8929325 -
Flags: review?(bechen) → review+
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8929326 [details]
Bug 1415090. P2 - move the "reopen on error" code from ChannelMediaResource::OnStopRequest() to MediaCacheStream::NotifyDataEnded().
https://reviewboard.mozilla.org/r/200644/#review205838
Attachment #8929326 -
Flags: review?(bechen) → review+
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8929329 [details]
Bug 1415090. P5 - remove MediaCacheStream::NotifyChannelRecreated().
https://reviewboard.mozilla.org/r/200650/#review205854
Attachment #8929329 -
Flags: review?(bechen) → review+
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8929327 [details]
Bug 1415090. P3 - run MediaCacheStream::NotifyDataEnded() off the main thread.
https://reviewboard.mozilla.org/r/200646/#review205874
Attachment #8929327 -
Flags: review?(bechen) → review+
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8929328 [details]
Bug 1415090. P4 - don't modify mResourceID off the main thread.
https://reviewboard.mozilla.org/r/200648/#review205876
::: dom/media/MediaCache.cpp
(Diff revision 1)
> - if (NS_FAILED(aStatus)) {
> - // Disconnect from other streams sharing our resource, since they
> - // should continue trying to load. Our load might have been deliberately
> - // canceled and that shouldn't affect other streams.
> - mResourceID = mMediaCache->AllocateResourceID();
> - }
Why remove AllocateResourceID()? Is the code useless?
Attachment #8929328 -
Flags: review?(bechen) → review+
Assignee | ||
Comment 11•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8929328 [details]
Bug 1415090. P4 - don't modify mResourceID off the main thread.
https://reviewboard.mozilla.org/r/200648/#review205876
> Why remove AllocateResourceID()? Is the code useless?
mResourceID can only be modified on the main thread while NotifyDataEndedInternal() runs off the main thread.
As the commit message said, this patch is about safely making a stream whose download ends abnormally
to continue sharing the resource.
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8929328 [details]
Bug 1415090. P4 - don't modify mResourceID off the main thread.
https://reviewboard.mozilla.org/r/200648/#review205878
Is is possible to merge the MediaCacheStream::mResourceID and MediaCacheStream::mLoadID?
Assignee | ||
Comment 13•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8929328 [details]
Bug 1415090. P4 - don't modify mResourceID off the main thread.
https://reviewboard.mozilla.org/r/200648/#review205878
No. They are totally different ideas.
mResourceID: MediaCacheStreams with the same resource id will share the same resource. That is, when one MediaCacheStream commit a block to the cache, this block will be also visible to others streams sharing the same resource id.
mLoadID: Used to identify different channels within a single MediaCacheStream. Since NotifyDataStarted() runs on the main thread while NotifyDataReceived() runs off the main thread, it is possible for NotifyDataStarted() from the new channel to run before NotifyDataReceived() from the old channel. mLoadID is used to check whether the callbacks are from the old channel and should be aborted.
Assignee | ||
Updated•7 years ago
|
Attachment #8929325 -
Flags: review?(gsquelart)
Attachment #8929326 -
Flags: review?(gsquelart)
Attachment #8929327 -
Flags: review?(gsquelart)
Attachment #8929328 -
Flags: review?(gsquelart)
Attachment #8929329 -
Flags: review?(gsquelart)
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8929325 [details]
Bug 1415090. P1 - always move the channel back to the foreground when OnStopRequest() is fired.
https://reviewboard.mozilla.org/r/200642/#review206148
Attachment #8929325 -
Flags: review?(gsquelart) → review+
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8929326 [details]
Bug 1415090. P2 - move the "reopen on error" code from ChannelMediaResource::OnStopRequest() to MediaCacheStream::NotifyDataEnded().
https://reviewboard.mozilla.org/r/200644/#review206150
Attachment #8929326 -
Flags: review?(gsquelart) → review+
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8929327 [details]
Bug 1415090. P3 - run MediaCacheStream::NotifyDataEnded() off the main thread.
https://reviewboard.mozilla.org/r/200646/#review206152
Attachment #8929327 -
Flags: review?(gsquelart) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8929328 [details]
Bug 1415090. P4 - don't modify mResourceID off the main thread.
https://reviewboard.mozilla.org/r/200648/#review206154
Attachment #8929328 -
Flags: review?(gsquelart) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8929329 [details]
Bug 1415090. P5 - remove MediaCacheStream::NotifyChannelRecreated().
https://reviewboard.mozilla.org/r/200650/#review206156
Attachment #8929329 -
Flags: review?(gsquelart) → review+
Assignee | ||
Comment 19•7 years ago
|
||
Thanks for the reviews!
Comment 20•7 years ago
|
||
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/846d1bec4f36
P1 - always move the channel back to the foreground when OnStopRequest() is fired. r=bechen,gerald
https://hg.mozilla.org/integration/autoland/rev/94287653dc31
P2 - move the "reopen on error" code from ChannelMediaResource::OnStopRequest() to MediaCacheStream::NotifyDataEnded(). r=bechen,gerald
https://hg.mozilla.org/integration/autoland/rev/d712d60574b6
P3 - run MediaCacheStream::NotifyDataEnded() off the main thread. r=bechen,gerald
https://hg.mozilla.org/integration/autoland/rev/222597bfd33b
P4 - don't modify mResourceID off the main thread. r=bechen,gerald
https://hg.mozilla.org/integration/autoland/rev/fdb2a41005f2
P5 - remove MediaCacheStream::NotifyChannelRecreated(). r=bechen,gerald
Comment 21•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/846d1bec4f36
https://hg.mozilla.org/mozilla-central/rev/94287653dc31
https://hg.mozilla.org/mozilla-central/rev/d712d60574b6
https://hg.mozilla.org/mozilla-central/rev/222597bfd33b
https://hg.mozilla.org/mozilla-central/rev/fdb2a41005f2
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Depends on: 1424937
Updated•7 years ago
|
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•