Changeset 264945 in webkit
- Timestamp:
- Jul 27, 2020, 2:57:15 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/Plugins/PDF/PDFPlugin.h (modified) (1 diff)
-
WebProcess/Plugins/PDF/PDFPlugin.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r264928 r264945 1 2020-07-27 Tim Horton <timothy_horton@apple.com> 2 3 Occasional crashes under PDFPlugin::createScrollbar and PDFPlugin::updateScrollbars 4 https://bugs.webkit.org/show_bug.cgi?id=214845 5 <rdar://problem/59293598> 6 7 Reviewed by Brady Eidson. 8 9 No new tests; timing is such that I can't reproduce without inserting 10 intentional delays into the main thread hops, which is further than 11 I'm willing to go for a test. 12 13 This is a speculative fix due to the aforementioned reproducibility issue. 14 15 * WebProcess/Plugins/PDF/PDFPlugin.h: 16 * WebProcess/Plugins/PDF/PDFPlugin.mm: 17 (WebKit::PDFPlugin::destroy): 18 Keep track of when destroy() has been called. 19 20 (WebKit::PDFPlugin::receivedNonLinearizedPDFSentinel): 21 (WebKit::PDFPlugin::threadEntry): 22 If the PDFPlugin is destroyed (explicit destroy(), not the destructor, which won't run since we're protecting `this`) 23 during the window in which the PDF thread is dispatching to the main thread, just ignore 24 the callback. We don't want to run it, because many of the things we depend on (like PluginView) 25 are disconnected at this point. 26 27 (WebKit::PDFPlugin::scrollbarStyleChanged): 28 It appears that in some much rarer case, even before the PDF thread existed, WebScrollerImpPairDelegate could 29 call us back after being destroy()'d but before being deallocated. Use the new bit to guard scrollbarStyleChanged(). 30 1 31 2020-07-27 Megan Gardner <megan_gardner@apple.com> 2 32 -
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
r260981 r264945 332 332 333 333 bool m_documentFinishedLoading { false }; 334 bool m_hasBeenDestroyed { false }; 334 335 unsigned m_firstPageHeight { 0 }; 335 336 WebCore::IntSize m_pdfDocumentSize; // All pages, including gaps. -
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
r264525 r264945 711 711 #endif 712 712 callOnMainThread([this, protectedThis = makeRef(*this)] { 713 if (m_hasBeenDestroyed) 714 return; 713 715 receivedNonLinearizedPDFSentinel(); 714 716 }); … … 886 888 if (m_incrementalPDFLoadingEnabled) { 887 889 callOnMainThread([this] { 890 if (m_hasBeenDestroyed) 891 return; 888 892 adoptBackgroundThreadDocument(); 889 893 }); … … 1431 1435 { 1432 1436 if (!forceUpdate) 1437 return; 1438 1439 if (m_hasBeenDestroyed) 1433 1440 return; 1434 1441 … … 1791 1798 void PDFPlugin::destroy() 1792 1799 { 1800 m_hasBeenDestroyed = true; 1793 1801 m_documentFinishedLoading = true; 1794 1802
Note:
See TracChangeset
for help on using the changeset viewer.