Bug 1691625 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

`mPendingGUMRequest` was implemented as a [incomplete band-aid](https://bugzilla.mozilla.org/show_bug.cgi?id=861716), with multiple flaws including the following.

The [check](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#2781) on whether to send a new request is based on whether there is an existing request for the relevant (inner) window, but pending requests are [dispatched](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3604) when a request in the same process (for a potentially different window) is completed.

Some error handling paths trigger SendPendingGUMRequest():
* [getUserMedia:response:deny](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3734-3740)
* [`AllocateDevices()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1422)

but others do not:
* [getUserMedia:response:allow](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3718)
* [`PrepareDOMStream()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1601)
* [`~GetUserMediaTask()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1332)

The queue blocks even requests that [do not need a prompt](https://bugzilla.mozilla.org/show_bug.cgi?id=861716#c34).
`mPendingGUMRequest` was implemented as an [incomplete band-aid](https://bugzilla.mozilla.org/show_bug.cgi?id=861716), with multiple flaws including the following.

The [check](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#2781) on whether to send a new request is based on whether there is an existing request for the relevant (inner) window, but pending requests are [dispatched](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3604) when a request in the same process (for a potentially different window) is completed.

Some error handling paths trigger SendPendingGUMRequest():
* [getUserMedia:response:deny](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3734-3740)
* [`AllocateDevices()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1422)

but others do not:
* [getUserMedia:response:allow](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#3718)
* [`PrepareDOMStream()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1601)
* [`~GetUserMediaTask()`](https://searchfox.org/mozilla-central/rev/7067bbd8194f4346ec59d77c33cd88f06763e090/dom/media/MediaManager.cpp#1332)

The queue blocks even requests that [do not need a prompt](https://bugzilla.mozilla.org/show_bug.cgi?id=861716#c34).

Back to Bug 1691625 Comment 0