Bug 223565

Summary: Add AVAudioSessionCaptureDeviceManager::isolatedCopy and use it to copy device list calculated on background queue
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebRTCAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, glenn, hta, jer.noble, philipj, sergio, tommyw, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Updated patch for landing none

Eric Carlson
Reported 2021-03-21 20:24:53 PDT
AVAudioSessionCaptureDeviceManager should use crossThreadCopy on CaptureDevice list allocated on a background queue.
Attachments
Patch (5.14 KB, patch)
2021-03-21 20:34 PDT, Eric Carlson
no flags
Patch for landing (5.83 KB, patch)
2021-03-22 10:15 PDT, Eric Carlson
no flags
Updated patch for landing (5.85 KB, patch)
2021-03-22 14:16 PDT, Eric Carlson
no flags
Eric Carlson
Comment 1 2021-03-21 20:25:46 PDT
Eric Carlson
Comment 2 2021-03-21 20:34:06 PDT
youenn fablet
Comment 3 2021-03-22 02:40:27 PDT
Comment on attachment 423848 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423848&action=review > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.h:42 > + AVAudioSessionCaptureDevice isolatedCopy() const; We could try to change it to: AVAudioSessionCaptureDevice isolatedCopy() &&; > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:61 > + groupId().isolatedCopy(), If we go with isolatedCopy() &&, doing WTFMove(m_persistentId).isolatedCopy(), WTFMove(m_groupId).isolatedCopy() will most probably remove the memory allocation of a new string.
Eric Carlson
Comment 4 2021-03-22 10:15:27 PDT
Created attachment 423905 [details] Patch for landing
youenn fablet
Comment 5 2021-03-22 11:27:18 PDT
Comment on attachment 423905 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=423905&action=review > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:58 > + m_persistentId.isolatedCopy(), WTFMove(m_persistentId) would remove a potential memory allocation. > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:61 > + m_groupId.isolatedCopy(), Ditto for m_label and m_groupId.
Eric Carlson
Comment 6 2021-03-22 14:16:21 PDT
Created attachment 423938 [details] Updated patch for landing
EWS
Comment 7 2021-03-22 16:57:40 PDT
Committed r274819: <https://commits.webkit.org/r274819> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423938 [details].
Note You need to log in before you can comment on or make changes to this bug.