Changeset 276044 in webkit
- Timestamp:
- Apr 15, 2021, 12:26:00 PM (5 years ago)
- Location:
- branches/safari-611-branch/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
-
branches/safari-611-branch/Source/WebCore/ChangeLog
r276043 r276044 1 2021-04-15 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r274819. rdar://problem/76373741 4 5 AVAudioSessionCaptureDeviceManager should use crossThreadCopy 6 https://bugs.webkit.org/show_bug.cgi?id=223565 7 <rdar://75480589> 8 9 Reviewed by Youenn Fablet. 10 11 Tested manually, this can only be tested on device. 12 13 * platform/mediastream/CaptureDevice.h: Change access restriction for member 14 variables from `private:` to `protected:` so derived classes can access them 15 directly. 16 17 * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: 18 * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: 19 (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice): New constructor. 20 (WebCore::AVAudioSessionCaptureDevice::isolatedCopy const): New. 21 22 * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: 23 (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Use 24 `WTFMove(deviceList).isolatedCopy()` when moving from AVAudioSession queue 25 to main thread. 26 (WebCore::AVAudioSessionCaptureDeviceManager::getCaptureDevices): Ditto. 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274819 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2021-03-22 Eric Carlson <eric.carlson@apple.com> 31 32 AVAudioSessionCaptureDeviceManager should use crossThreadCopy 33 https://bugs.webkit.org/show_bug.cgi?id=223565 34 <rdar://75480589> 35 36 Reviewed by Youenn Fablet. 37 38 Tested manually, this can only be tested on device. 39 40 * platform/mediastream/CaptureDevice.h: Change access restriction for member 41 variables from `private:` to `protected:` so derived classes can access them 42 directly. 43 44 * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: 45 * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: 46 (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice): New constructor. 47 (WebCore::AVAudioSessionCaptureDevice::isolatedCopy const): New. 48 49 * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: 50 (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Use 51 `WTFMove(deviceList).isolatedCopy()` when moving from AVAudioSession queue 52 to main thread. 53 (WebCore::AVAudioSessionCaptureDeviceManager::getCaptureDevices): Ditto. 54 1 55 2021-04-15 Russell Epstein <repstein@apple.com> 2 56 -
branches/safari-611-branch/Source/WebCore/platform/mediastream/CaptureDevice.h
r275958 r276044 131 131 #endif 132 132 133 pr ivate:133 protected: 134 134 String m_persistentId; 135 135 DeviceType m_type { DeviceType::Unknown }; -
branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.h
r275958 r276044 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 -
branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm
r275958 r276044 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 -
branches/safari-611-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm
r275958 r276044 167 167 dispatch_sync(m_dispatchQueue, makeBlockPtr([&] { 168 168 newAudioDevices = retrieveAudioSessionCaptureDevices(); 169 }) .get());170 setAudioCaptureDevices(WTFMove(newAudioDevices) );169 }); 170 setAudioCaptureDevices(WTFMove(newAudioDevices).isolatedCopy()); 171 171 } 172 172 … … 183 183 dispatch_async(m_dispatchQueue, makeBlockPtr([this, completion = WTFMove(completion)] () mutable { 184 184 auto newAudioDevices = retrieveAudioSessionCaptureDevices(); 185 callOnWebThreadOrDispatchAsyncOnMainThread(makeBlockPtr([this, completion = WTFMove(completion), newAudioDevices = WTFMove(newAudioDevices) ] () mutable {185 callOnWebThreadOrDispatchAsyncOnMainThread(makeBlockPtr([this, completion = WTFMove(completion), newAudioDevices = WTFMove(newAudioDevices).isolatedCopy()] () mutable { 186 186 setAudioCaptureDevices(WTFMove(newAudioDevices)); 187 187 completion(copyToVector(*m_devices));
Note:
See TracChangeset
for help on using the changeset viewer.