Add null checks and smart pointers in PDF and Plugin code
Created attachment 412220 [details] Patch
Created attachment 412221 [details] Patch
Comment on attachment 412221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412221&action=review > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:620 > + Document* document = frame.coreFrame()->document(); auto > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1855 > + m_frame->page()->updatePDFHUDLocation(*this, frameForHUD()); Are we sure page is non null? > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1922 > LocalDefaultSystemAppearance localAppearance(page->useDarkAppearance()); Check page? > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:2302 > + if (!m_frame) Could do if (!m_frame || !m_frame->coreFrame()). > Source/WebKit/WebProcess/WebPage/WebFrame.h:160 > + void setLoadListener(LoadListener* loadListener) { m_loadListener = makeWeakPtr(loadListener); } Could we pass a LoadListener&?
Comment on attachment 412221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412221&action=review >> Source/WebKit/WebProcess/WebPage/WebFrame.h:160 >> + void setLoadListener(LoadListener* loadListener) { m_loadListener = makeWeakPtr(loadListener); } > > Could we pass a LoadListener&? nope, but I'll update the old call sites that call it with 0 to call it with nullptr.
Created attachment 412335 [details] Patch
Committed r268989: <https://trac.webkit.org/changeset/268989> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412335 [details].
<rdar://problem/70688355>
<rdar://problem/69931543>