[webkit-reviews] review granted: [Bug 209417] MediaDevices::refreshDevices should take device type into account : [Attachment 394251] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 23 06:58:41 PDT 2020


Eric Carlson <eric.carlson at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 209417: MediaDevices::refreshDevices should take device type into account
https://bugs.webkit.org/show_bug.cgi?id=209417

Attachment 394251: Patch

https://bugs.webkit.org/attachment.cgi?id=394251&action=review




--- Comment #3 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 394251
  --> https://bugs.webkit.org/attachment.cgi?id=394251
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394251&action=review

> Source/WebCore/Modules/mediastream/MediaDevices.cpp:186
> +	   auto deviceKind = newDevice.type() ==
CaptureDevice::DeviceType::Microphone ? MediaDeviceInfo::Kind::Audioinput :
MediaDeviceInfo::Kind::Videoinput;
> +	   auto index = m_devices.findMatching([deviceKind, &newDevice](auto&
oldDevice) {
> +	       return oldDevice->deviceId() == newDevice.persistentId() &&
oldDevice->kind() == deviceKind;

How does this help the case where there is more than one device of a given
type? Or is that not an issue because we have device IDs if `newDevices` has
more than one device of any type?


More information about the webkit-reviews mailing list