Changeset 290109 in webkit
- Timestamp:
- Feb 17, 2022, 7:55:27 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
page/scrolling/ThreadedScrollingTree.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r290108 r290109 1 2022-02-17 Simon Fraser <simon.fraser@apple.com> 2 3 Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged() 4 https://bugs.webkit.org/show_bug.cgi?id=236810 5 <rdar://89072235> 6 7 Reviewed by Dean Jackson. 8 9 Crash data suggests that r288933 didn't fix the crash entirely. 10 11 Although the code paths I can find appear to hold the lock, there may be an 12 opportunity for m_scrollingCoordinator to get nulled out after we null-check it 13 but before the copy for the main thread dispatch. 14 15 So make a RefPtr on the stack, null-check it, and then move it into the callback. 16 17 * page/scrolling/ThreadedScrollingTree.cpp: 18 (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged): 19 (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea): 20 (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): 21 (WebCore::ThreadedScrollingTree::handleWheelEventPhase): 22 (WebCore::ThreadedScrollingTree::setActiveScrollSnapIndices): 23 (WebCore::ThreadedScrollingTree::hasNodeWithAnimatedScrollChanged): 24 1 25 2022-02-17 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
r288933 r290109 284 284 void ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, OptionSet<SynchronousScrollingReason> reasons) 285 285 { 286 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, reasons] { 286 auto scrollingCoordinator = m_scrollingCoordinator; 287 if (!scrollingCoordinator) 288 return; 289 290 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), timestamp, reasons] { 287 291 scrollingCoordinator->reportSynchronousScrollingReasonsChanged(timestamp, reasons); 288 292 }); … … 291 295 void ThreadedScrollingTree::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea) 292 296 { 293 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, unfilledArea] { 297 auto scrollingCoordinator = m_scrollingCoordinator; 298 if (!scrollingCoordinator) 299 return; 300 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), timestamp, unfilledArea] { 294 301 scrollingCoordinator->reportExposedUnfilledArea(timestamp, unfilledArea); 295 302 }); … … 299 306 void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, std::optional<unsigned> horizontal, std::optional<unsigned> vertical) 300 307 { 301 if (!m_scrollingCoordinator) 302 return; 303 304 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, nodeID, horizontal, vertical] { 308 auto scrollingCoordinator = m_scrollingCoordinator; 309 if (!scrollingCoordinator) 310 return; 311 312 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), nodeID, horizontal, vertical] { 305 313 scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontal, vertical); 306 314 }); … … 311 319 void ThreadedScrollingTree::handleWheelEventPhase(ScrollingNodeID nodeID, PlatformWheelEventPhase phase) 312 320 { 313 if (!m_scrollingCoordinator) 314 return; 315 316 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, nodeID, phase] { 321 auto scrollingCoordinator = m_scrollingCoordinator; 322 if (!scrollingCoordinator) 323 return; 324 325 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), nodeID, phase] { 317 326 scrollingCoordinator->handleWheelEventPhase(nodeID, phase); 318 327 }); … … 321 330 void ThreadedScrollingTree::setActiveScrollSnapIndices(ScrollingNodeID nodeID, std::optional<unsigned> horizontalIndex, std::optional<unsigned> verticalIndex) 322 331 { 323 if (!m_scrollingCoordinator) 332 auto scrollingCoordinator = m_scrollingCoordinator; 333 if (!scrollingCoordinator) 324 334 return; 325 335 326 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, nodeID, horizontalIndex, verticalIndex] {336 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), nodeID, horizontalIndex, verticalIndex] { 327 337 scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontalIndex, verticalIndex); 328 338 }); … … 378 388 void ThreadedScrollingTree::hasNodeWithAnimatedScrollChanged(bool hasNodeWithAnimatedScroll) 379 389 { 380 if (!m_scrollingCoordinator) 381 return; 382 383 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, hasNodeWithAnimatedScroll] { 390 auto scrollingCoordinator = m_scrollingCoordinator; 391 if (!scrollingCoordinator) 392 return; 393 394 RunLoop::main().dispatch([scrollingCoordinator = WTFMove(scrollingCoordinator), hasNodeWithAnimatedScroll] { 384 395 scrollingCoordinator->hasNodeWithAnimatedScrollChanged(hasNodeWithAnimatedScroll); 385 396 });
Note:
See TracChangeset
for help on using the changeset viewer.