Bug 1744350 consistently provide device sets by return value instead of side-effects...
commiteda27bb86c20bfd3c9f900fd92245d83209d4f01
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 21 Dec 2021 02:43:29 +0000 (21 02:43 +0000)
committerKarl Tomlinson <karlt+@karlt.net>
Tue, 21 Dec 2021 02:43:29 +0000 (21 02:43 +0000)
tree9217dec014c9db142271e181c5404b37fb81d3ee
parent05b8eae0d7445226835acc24ab2ca198bd33e825
Bug 1744350 consistently provide device sets by return value instead of side-effects r=jib

for clearer indication of data flow.
https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs

SelectSettings() is modified to reject instead of resolve its promise on
failure to provide more intuitive execution paths.

These changes also allow the removal of a lambda function that existed solely
to convert between the calling conventions, and better align with a subsequent
change to use different types to distinguish raw and window-specific media
device info objects.

Differential Revision: https://phabricator.services.mozilla.com/D132883
dom/media/MediaDevices.cpp
dom/media/MediaManager.cpp
dom/media/MediaManager.h