Changeset 226276 in webkit


Ignore:
Timestamp:
Dec 22, 2017, 1:41:02 PM (7 years ago)
Author:
mitz@apple.com
Message:

Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestAnimationFrame callback removes the requesting iframe
https://bugs.webkit.org/show_bug.cgi?id=181132
<rdar://problem/35143540>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/animation/request-animation-frame-remove-iframe-in-callback.html

  • dom/ScriptedAnimationController.cpp:

(WebCore::ScriptedAnimationController::serviceScriptedAnimations): Hold a reference to the

document and pass that along to InspectorInstrumentation::willFireAnimationFrame rather
than dereferencing the m_document member, which may have gotten cleared by an earlier
callback.

LayoutTests:

  • fast/animation/request-animation-frame-remove-iframe-in-callback-expected.txt: Added.
  • fast/animation/request-animation-frame-remove-iframe-in-callback.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r226274 r226276  
     12017-12-22  Dan Bernstein  <mitz@apple.com>
     2
     3        Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestAnimationFrame callback removes the requesting iframe
     4        https://bugs.webkit.org/show_bug.cgi?id=181132
     5        <rdar://problem/35143540>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/animation/request-animation-frame-remove-iframe-in-callback-expected.txt: Added.
     10        * fast/animation/request-animation-frame-remove-iframe-in-callback.html: Added.
     11
    1122017-12-22  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r226275 r226276  
     12017-12-22  Dan Bernstein  <mitz@apple.com>
     2
     3        Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestAnimationFrame callback removes the requesting iframe
     4        https://bugs.webkit.org/show_bug.cgi?id=181132
     5        <rdar://problem/35143540>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: fast/animation/request-animation-frame-remove-iframe-in-callback.html
     10
     11        * dom/ScriptedAnimationController.cpp:
     12        (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Hold a reference to the
     13          document and pass that along to InspectorInstrumentation::willFireAnimationFrame rather
     14          than dereferencing the m_document member, which may have gotten cleared by an earlier
     15          callback.
     16
    1172017-12-22  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r223728 r226276  
    210210    // reference to us, so take a defensive reference.
    211211    Ref<ScriptedAnimationController> protectedThis(*this);
     212    Ref<Document> protectedDocument(*m_document);
    212213
    213214    for (auto& callback : callbacks) {
    214215        if (!callback->m_firedOrCancelled) {
    215216            callback->m_firedOrCancelled = true;
    216             InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(*m_document, callback->m_id);
     217            InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(protectedDocument, callback->m_id);
    217218            if (callback->m_useLegacyTimeBase)
    218219                callback->handleEvent(legacyHighResNowMs);
Note: See TracChangeset for help on using the changeset viewer.