⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 202923 in webkit


Ignore:
Timestamp:
Jul 7, 2016, 11:53:19 AM (10 years ago)
Author:
jer.noble@apple.com
Message:

Crash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
https://bugs.webkit.org/show_bug.cgi?id=159517
<rdar://problem/27221109>

Reviewed by Eric Carlson.

When WebKit on iOS gets a notification that the UIProcess has been backgrounded, it sends an
interruption event to the WebProcess to pause any playing HTMLMediaElements. When the
elements which get this interruption have pending promises created during a previous call to
play(), these promises get rejected.

However, if the HTMLMediaElement's document has already been destroyed, the pending Promises
are in an inconsistent state: their script execution context (the document) has been
destroyed, leading to the crash in JSLockHolder.

When HTMLMediaElement is notified that its ScriptExecutionContext has been destroyed, also
clear the list of pending Promises.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::contextDestroyed):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202918 r202923  
     12016-07-07  Jer Noble  <jer.noble@apple.com>
     2
     3        Crash due to HTMLMediaElement at JavaScriptCore: JSC::JSLockHolder::JSLockHolder
     4        https://bugs.webkit.org/show_bug.cgi?id=159517
     5        <rdar://problem/27221109>
     6
     7        Reviewed by Eric Carlson.
     8
     9        When WebKit on iOS gets a notification that the UIProcess has been backgrounded, it sends an
     10        interruption event to the WebProcess to pause any playing HTMLMediaElements. When the
     11        elements which get this interruption have pending promises created during a previous call to
     12        play(), these promises get rejected.
     13
     14        However, if the HTMLMediaElement's document has already been destroyed, the pending Promises
     15        are in an inconsistent state: their script execution context (the document) has been
     16        destroyed, leading to the crash in JSLockHolder.
     17
     18        When HTMLMediaElement is notified that its ScriptExecutionContext has been destroyed, also
     19        clear the list of pending Promises.
     20
     21        * html/HTMLMediaElement.cpp:
     22        (WebCore::HTMLMediaElement::contextDestroyed):
     23
    1242016-07-05  Jer Noble  <jer.noble@apple.com>
    225
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r202918 r202923  
    50975097    m_updatePlaybackControlsManagerQueue.close();
    50985098
     5099    m_pendingPlayPromises.clear();
     5100
    50995101    ActiveDOMObject::contextDestroyed();
    51005102}
Note: See TracChangeset for help on using the changeset viewer.