Changeset 248853 in webkit
- Timestamp:
- Aug 19, 2019 8:46:04 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r248851 r248853 1 2019-08-19 Youenn Fablet <youenn@apple.com> 2 3 Stop MediaDevices timer when stopping MediaDevices 4 https://bugs.webkit.org/show_bug.cgi?id=200880 5 6 Reviewed by Eric Carlson. 7 8 No change of behavior. 9 Stop timer when stopping MediaDevices and check for MediaDevices being stopped before scheduling the timer. 10 11 * Modules/mediastream/MediaDevices.cpp: 12 (WebCore::MediaDevices::stop): 13 Remove document/controller check since at that point, 14 the document should not be null and the controller should be there. 15 (WebCore::MediaDevices::scheduledEventTimerFired): 16 (WebCore::MediaDevices::listenForDeviceChanges): 17 1 18 2019-08-19 Yusuke Suzuki <ysuzuki@apple.com> 2 19 -
trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp
r248847 r248853 74 74 { 75 75 if (m_deviceChangeToken) { 76 auto* document = this->document(); 77 auto* controller = document ? UserMediaController::from(document->page()) : nullptr; 78 if (document && controller) 79 controller->removeDeviceChangeObserver(m_deviceChangeToken); 76 auto* controller = UserMediaController::from(document()->page()); 77 controller->removeDeviceChangeObserver(m_deviceChangeToken); 80 78 } 81 79 m_devices.clear(); 80 m_scheduledEventTimer.stop(); 82 81 } 83 82 … … 207 206 void MediaDevices::scheduledEventTimerFired() 208 207 { 209 if (isContextStopped()) 210 return; 211 208 ASSERT(!isContextStopped()); 212 209 dispatchEvent(Event::create(eventNames().devicechangeEvent, Event::CanBubble::No, Event::IsCancelable::No)); 213 210 } … … 241 238 242 239 m_deviceChangeToken = controller->addDeviceChangeObserver([weakThis = makeWeakPtr(*this), this]() { 243 if (!weakThis || m_scheduledEventTimer.isActive())240 if (!weakThis || isContextStopped() || m_scheduledEventTimer.isActive()) 244 241 return; 245 242
Note: See TracChangeset
for help on using the changeset viewer.