Changeset 147370 in webkit


Ignore:
Timestamp:
Apr 1, 2013 5:00:16 PM (11 years ago)
Author:
Nate Chapin
Message:

Crash in WebCore::HTMLMediaElement::~HTMLMediaElement.
https://bugs.webkit.org/show_bug.cgi?id=113531

Reviewed by Adam Barth.

No new tests, though this is intermittently reproducible with
http/tests/misc/delete-frame-during-readystatechange.html under ASAN.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::~HTMLMediaElement): Clear the media player manually

before the destructor exits. Clearing the media player may cancel a resource load,
which can trigger a readystatechange event. It's possible for the HTMLMediaElement
to attempt to fire an abort event within the readystatechange event, even though it is
now in an inconsistent state. Clearling the media player before finishing the destructor
ensures that the HTMLMediaElement will at least still be alive if this case is triggered.
Set m_completelyLoaded to true to ensure that if userCancelledLoad() is called, it doesn't
attempt to fire events while destructing.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147369 r147370  
     12013-04-01  Nate Chapin  <japhet@chromium.org>
     2
     3        Crash in WebCore::HTMLMediaElement::~HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=113531
     5
     6        Reviewed by Adam Barth.
     7
     8        No new tests, though this is intermittently reproducible with
     9        http/tests/misc/delete-frame-during-readystatechange.html under ASAN.
     10
     11        * html/HTMLMediaElement.cpp:
     12        (WebCore::HTMLMediaElement::~HTMLMediaElement): Clear the media player manually
     13            before the destructor exits. Clearing the media player may cancel a resource load,
     14            which can trigger a readystatechange event. It's possible for the HTMLMediaElement
     15            to attempt to fire an abort event within the readystatechange event, even though it is
     16            now in an inconsistent state. Clearling the media player before finishing the destructor
     17            ensures that the HTMLMediaElement will at least still be alive if this case is triggered.
     18            Set m_completelyLoaded to true to ensure that if userCancelledLoad() is called, it doesn't
     19            attempt to fire events while destructing.
     20
    1212013-04-01  Sheriff Bot  <webkit.review.bot@gmail.com>
    222
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r147001 r147370  
    350350
    351351    removeElementFromDocumentMap(this, document());
     352
     353    m_completelyLoaded = true;
     354    clearMediaPlayer(-1);
    352355}
    353356
Note: See TracChangeset for help on using the changeset viewer.