r260182 causes fast/events/event-handler-detached-document-dispatchEvent.html to crash.
<rdar://problem/62072269>
Created attachment 397197 [details] Patch
Comment on attachment 397197 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397197&action=review r=me, with nit. > Source/WebCore/html/MediaElementSession.cpp:146 > + if (m_haveAddedMediaUsageManagerSession) > + return; > + > + auto page = m_element.document().page(); > + if (!page) > + return; > + > + page->chrome().client().addMediaUsageManagerSession(mediaSessionIdentifier(), m_element.sourceApplicationIdentifier(), m_element.document().url()); > + m_haveAddedMediaUsageManagerSession = true; A smart person once told me <https://bugs.webkit.org/show_bug.cgi?id=210589#c3> that they preferred to set this kind of state before calling the callback to protect against re-entrancy. ;)
Comment on attachment 397197 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397197&action=review >> Source/WebCore/html/MediaElementSession.cpp:146 >> + m_haveAddedMediaUsageManagerSession = true; > > A smart person once told me <https://bugs.webkit.org/show_bug.cgi?id=210589#c3> that they preferred to set this kind of state before calling the callback to protect against re-entrancy. ;) LOL, good point!
Created attachment 397224 [details] Patch for landing.
Committed r260529: <https://trac.webkit.org/changeset/260529> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397224 [details].