AudioContext uses m_document only as a pointer to ScriptExecutionContext. It could be safely replaced with ContextDestructionObserver::m_scriptExecutionContext. The lifetime of m_scriptExecutionContext is slightly different but it could be adjusted by m_isStopScheduled flag.
Created attachment 174900 [details] Patch
Comment on attachment 174900 [details] Patch Thanks!
*** Bug 99242 has been marked as a duplicate of this bug. ***
Committed r135116: <http://trac.webkit.org/changeset/135116>
Reverted r135116 for reason: Revert this patch to revert r135111, which caused crashes in several layout tests Committed r135144: <http://trac.webkit.org/changeset/135144>
Committed r135156: <http://trac.webkit.org/changeset/135156>