Changeset 274819 in webkit
- Timestamp:
- Mar 22, 2021, 4:57:35 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
platform/mediastream/CaptureDevice.h (modified) (1 diff)
-
platform/mediastream/ios/AVAudioSessionCaptureDevice.h (modified) (1 diff)
-
platform/mediastream/ios/AVAudioSessionCaptureDevice.mm (modified) (1 diff)
-
platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274818 r274819 1 2021-03-22 Eric Carlson <eric.carlson@apple.com> 2 3 AVAudioSessionCaptureDeviceManager should use crossThreadCopy 4 https://bugs.webkit.org/show_bug.cgi?id=223565 5 <rdar://75480589> 6 7 Reviewed by Youenn Fablet. 8 9 Tested manually, this can only be tested on device. 10 11 * platform/mediastream/CaptureDevice.h: Change access restriction for member 12 variables from `private:` to `protected:` so derived classes can access them 13 directly. 14 15 * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: 16 * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: 17 (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice): New constructor. 18 (WebCore::AVAudioSessionCaptureDevice::isolatedCopy const): New. 19 20 * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: 21 (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Use 22 `WTFMove(deviceList).isolatedCopy()` when moving from AVAudioSession queue 23 to main thread. 24 (WebCore::AVAudioSessionCaptureDeviceManager::getCaptureDevices): Ditto. 25 1 26 2021-03-22 Patrick Angle <pangle@apple.com> 2 27 -
trunk/Source/WebCore/platform/mediastream/CaptureDevice.h
r270986 r274819 131 131 #endif 132 132 133 pr ivate:133 protected: 134 134 String m_persistentId; 135 135 DeviceType m_type { DeviceType::Unknown }; -
trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.h
r269688 r274819 40 40 virtual ~AVAudioSessionCaptureDevice() = default; 41 41 42 AVAudioSessionCaptureDevice isolatedCopy() &&; 43 42 44 private: 43 45 AVAudioSessionCaptureDevice(AVAudioSessionPortDescription *deviceInput, AVAudioSessionPortDescription *defaultInput); 46 AVAudioSessionCaptureDevice(const String& persistentId, DeviceType, const String& label, const String& groupId, bool isEnabled, bool isDefault, bool isMock); 44 47 }; 45 48 -
trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm
r269688 r274819 45 45 } 46 46 47 AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice(const String& persistentId, DeviceType type, const String& label, const String& groupId, bool isEnabled, bool isDefault, bool isMock) 48 : CaptureDevice(persistentId, type, label, groupId) 49 { 50 setEnabled(isEnabled); 51 setIsDefault(isDefault); 52 setIsMockDevice(isMock); 53 } 54 55 AVAudioSessionCaptureDevice AVAudioSessionCaptureDevice::isolatedCopy() && 56 { 57 return { 58 WTFMove(m_persistentId).isolatedCopy(), 59 m_type, 60 WTFMove(m_label).isolatedCopy(), 61 WTFMove(m_groupId).isolatedCopy(), 62 m_enabled, 63 m_default, 64 m_isMockDevice, 65 }; 66 } 67 47 68 } 48 69 -
trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm
r274296 r274819 164 164 newAudioDevices = retrieveAudioSessionCaptureDevices(); 165 165 }); 166 setAudioCaptureDevices(WTFMove(newAudioDevices) );166 setAudioCaptureDevices(WTFMove(newAudioDevices).isolatedCopy()); 167 167 } 168 168 … … 179 179 m_dispatchQueue->dispatch([this, completion = WTFMove(completion)] () mutable { 180 180 auto newAudioDevices = retrieveAudioSessionCaptureDevices(); 181 callOnWebThreadOrDispatchAsyncOnMainThread(makeBlockPtr([this, completion = WTFMove(completion), newAudioDevices = WTFMove(newAudioDevices) ] () mutable {181 callOnWebThreadOrDispatchAsyncOnMainThread(makeBlockPtr([this, completion = WTFMove(completion), newAudioDevices = WTFMove(newAudioDevices).isolatedCopy()] () mutable { 182 182 setAudioCaptureDevices(WTFMove(newAudioDevices)); 183 183 completion(copyToVector(*m_devices));
Note:
See TracChangeset
for help on using the changeset viewer.