Closed
Bug 1745443
Opened 2 years ago
Closed 2 years ago
Keep alive the MIDIAccess and MIDIPort objects as long as there's pending activity
Categories
(Core :: DOM: Device Interfaces, task)
Core
DOM: Device Interfaces
Tracking
()
RESOLVED
FIXED
97 Branch
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: gsvelto, Assigned: gsvelto)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
My investigation in how Chrome deals with MIDI objects is down to this:
MIDIAccess
objects are kept alive as long as they have astatechange
listener and their parent execution context is alive, even if there are no other JS references to themMIDIPort
objects are kept alive as long as they have not been closed (that is they are open or they're in a pending state and can be opened via aMIDIConnectionEvent
). This means that if there are no other JS references but a event handler/listener is present (statechange
for both input and output ormidimessage
for input) we should still keep them alive.
Additionally we should disable the bfcache for pages using the Web MIDI API and implicitly close the ports when the user navigates away from the page using it.
This is somewhat consistent with APIs dealing with network activity (e.g. WebSocket).
Assignee | ||
Comment 1•2 years ago
|
||
MIDI ports will be kept alive even without direct JS references to it under
the following conditions:
- They've not been explicitly closed (they're open or waiting to be)
- A statechange listener is present
- A midimessage listener is present for input ports only
- They've not been disconnected from their owner, when they are we implicitly
close them
MIDI access objects will be kept alive even without direct JS references to it
under the following conditions:
- A statechange listener is present
- They've not been disconnected from their owner
Finally whenever a MIDI port is in use we disable the bfcache on the
document.
Updated•2 years ago
|
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0941225b4ed Keep MIDI objects alive as long as there's some pending activity r=smaug
Comment 3•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox97:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•