Closed Bug 1744346 Opened 2 years ago Closed 2 years ago

Use MediaDevice mID and mRawID fields consistently

Categories

(Core :: WebRTC: Audio/Video, task, P1)

task

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox96 --- wontfix
firefox97 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(8 files)

Currently, sometimes mID contains a raw id and sometimes an anonymized id.

Blocks: 1744350

The key motivator here was the misleading aForceNoPermRequest parameter.
This came from an unreviewed change in response to a review request.
https://phabricator.services.mozilla.com/D14575?vs=44463&id=47352#inline-82282
The newer variable name described the opposite of its use, but its usage was
not negated.

The logical change to the AllowPermissionRequest flag no longer passed from
MediaDevices::GetSinkDevice() has little effect because any permission
required would be obtained from getUserMedia() or selectAudioOutput() prior to
setSinkId(). A permission request is not expected during setSinkId().

The EnumerateAudioOutputs flag removes some use of the confusing
MediaSinkEnum::Other and makes the long list of parameters slightly easier to
read.

and use nsIMediaSource.rawId to initialize the id field.

rawId is otherwise unused in GeckoView and Android Components.

GeckoView uses MediaSource.id simply as a unique identifier to find associated
nsIMediaSource objects.

Android Components uses MediaSource.id simply as a unique identifier to find
a MediaSource from an associated Permission object.
https://searchfox.org/mozilla-mobile/rev/2df7441e996a8e4adfc25a2190415d50f6cf810a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/permission/GeckoPermissionRequest.kt#137
id is not used when storing the permission.
https://searchfox.org/mozilla-mobile/rev/2df7441e996a8e4adfc25a2190415d50f6cf810a/android-components/components/feature/sitepermissions/src/main/java/mozilla/components/feature/sitepermissions/SitePermissionsFeature.kt#643-648

Use of nsIMediaSource.rawId is consistent with Firefox for Desktop.
https://searchfox.org/mozilla-central/rev/0998b61022a1ece43afe3c750077e5804c6c6392/browser/actors/WebRTCChild.jsm#324

This will permit removal of nsIMediaSource.id which is otherwise unused.

Depends on D132875

This may have been unused since a different constructor was added for AnonymizeDevices() in
https://hg.mozilla.org/mozilla-central/rev/d4d476a32ea823ee98a40bedbcdd509dee5dc84c#l3.256

Depends on D132878

Depends on D132879

to clarify which data is used by getters.

Depends on D132881

Attachment #9253789 - Attachment description: Bug 1744346 remove rawId field from PermissionDelegate.MediaSource r?#geckoview-reviewers → Bug 1744346 use nsIMediaSource.rawId to initialize PermissionDelegate.MediaSource.id r?agi
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f8897871c71e
use nsIMediaSource.rawId to initialize PermissionDelegate.MediaSource.id r=agi
Keywords: leave-open
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/020a55212036
consolidate boolean device enumeration parameters into a flags parameter r=jib
https://hg.mozilla.org/integration/autoland/rev/66269278654b
test that the mochitest window is among the scary r=jib
https://hg.mozilla.org/integration/autoland/rev/3a48eec2115a
remove unused nsIMediaDevice properties r=jib
https://hg.mozilla.org/integration/autoland/rev/7aae55aeb724
remove unused raw MediaDevice constructor parameter aRawID r=jib
https://hg.mozilla.org/integration/autoland/rev/913d8b936920
simplify MediaDevice group id changes r=jib
https://hg.mozilla.org/integration/autoland/rev/f37ffa0cae82
remove unused AnonymizeDevices path for empty aOriginKey r=jib
Keywords: leave-open
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/504c4fa4291c
consistently store raw MediaDevice ids and name in raw fields r=jib
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: