Closed
Bug 1157803
Opened 9 years ago
Closed 9 years ago
Use state mirroring for mPlayState
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(7 files)
964 bytes,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
4.10 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
3.35 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
1.35 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
1.62 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
2.66 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
16.10 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
State mirroring is about to land (\o/), and I think the next good application would be to mirror MediaDecoder::mPlayState into the MDSM, so that we don't need to call GetPlayState cross-thread. Combined with the right state-watching calls, we should be able to eliminated MDSM::Play, as well as MediaDecoder::ApplyStateToStateMachine.
Assignee | ||
Comment 1•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c8c56dd63dcb
Assignee | ||
Comment 2•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a252dfbf89a6
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8599044 -
Flags: review?(jwwang)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8599045 -
Flags: review?(jwwang)
Assignee | ||
Comment 5•9 years ago
|
||
The MDSM is constructed and destroyed on the main thread, but runs most everything else on the task queue. So we need to bend the rules a bit here to conveniently connect its mirrors during construction.
Attachment #8599046 -
Flags: review?(jwwang)
Assignee | ||
Comment 6•9 years ago
|
||
Another consequence of the MDSM's thread model.
Attachment #8599047 -
Flags: review?(jwwang)
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8599048 -
Flags: review?(jwwang)
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8599049 -
Flags: review?(jwwang)
Assignee | ||
Comment 9•9 years ago
|
||
Attachment #8599050 -
Flags: review?(jwwang)
Assignee | ||
Comment 10•9 years ago
|
||
Note that some of the ergonomics here are going to be improved in bug 1159558.
Comment 11•9 years ago
|
||
Comment on attachment 8599044 [details] [diff] [review] Part 1 - Add an extra assertion to MediaTaskQueue::BeginShutdown. v1 Review of attachment 8599044 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/media/MediaTaskQueue.cpp @@ +158,5 @@ > > nsRefPtr<ShutdownPromise> > MediaTaskQueue::BeginShutdown() > { > + // Make the there are no tasks for this queue waiting in the caller's tail Make sure
Attachment #8599044 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8599045 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8599046 -
Flags: review?(jwwang) → review+
Comment 12•9 years ago
|
||
Comment on attachment 8599047 [details] [diff] [review] Part 4 - Don't auto-disconnect mirrors when the holder is destroyed off-owner-thread. v1 Review of attachment 8599047 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/media/StateMirroring.h @@ +351,5 @@ > + // If holder destruction happens on a thread other than the mirror's > + // owner thread, manual disconnection is mandatory. We should make this > + // more automatic by hooking it up to task queue shutdown. > + MOZ_DIAGNOSTIC_ASSERT(!mMirror->IsConnected()); > + } This is fine. But I think it is easier for the client code to remember "always do manual disconnection before destroying Holder" than to remember "do manual disconnection if you are gonna destroy Holder on some other thread". Again, we should avoid exposing thread details to the client code when possible.
Attachment #8599047 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8599048 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8599049 -
Flags: review?(jwwang) → review+
Comment 13•9 years ago
|
||
Comment on attachment 8599050 [details] [diff] [review] Part 7 - Mirror mPlayState and mNextState to the state machine task queue and eliminate cross-thread access. v1 Review of attachment 8599050 [details] [diff] [review]: ----------------------------------------------------------------- Good!
Attachment #8599050 -
Flags: review?(jwwang) → review+
Assignee | ||
Comment 14•9 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/4d0265c15acc remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/4a2c2ef2e24a remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/219435f463d2 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/4a072723d1d9 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/cd9eec88aa05 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/3eee65370b2b remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/5b8e33d6ad71
https://hg.mozilla.org/mozilla-central/rev/4d0265c15acc https://hg.mozilla.org/mozilla-central/rev/4a2c2ef2e24a https://hg.mozilla.org/mozilla-central/rev/219435f463d2 https://hg.mozilla.org/mozilla-central/rev/4a072723d1d9 https://hg.mozilla.org/mozilla-central/rev/cd9eec88aa05 https://hg.mozilla.org/mozilla-central/rev/3eee65370b2b https://hg.mozilla.org/mozilla-central/rev/5b8e33d6ad71
Assignee: nobody → bobbyholley
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•