Changeset 243104 in webkit


Ignore:
Timestamp:
Mar 18, 2019 2:27:09 PM (5 years ago)
Author:
Chris Dumez
Message:

REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
https://bugs.webkit.org/show_bug.cgi?id=195322

Reviewed by Ryosuke Niwa.

Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
their iframe element gets removed from the document. Previously, DOMWindow was a
FrameDestructionObserver and would stay connected to its frame until the frame died.

This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
Document::willDetachPage() no longer happens for subframe windows because they get
disconnected from their frame because they get a chance to get such notifications.
To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
which gets called when the iframe gets removed from the document and the document / window
get disconnected from the Frame element.

No new tests, verified locally that the leak is gone on JetStream.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::willDetachDocumentFromFrame):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243103 r243104  
     12019-03-18  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
     4        https://bugs.webkit.org/show_bug.cgi?id=195322
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
     9        their iframe element gets removed from the document. Previously, DOMWindow was a
     10        FrameDestructionObserver and would stay connected to its frame until the frame died.
     11
     12        This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
     13        Document::willDetachPage() no longer happens for subframe windows because they get
     14        disconnected from their frame because they get a chance to get such notifications.
     15        To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
     16        which gets called when the iframe gets removed from the document and the document / window
     17        get disconnected from the Frame element.
     18
     19        No new tests, verified locally that the leak is gone on JetStream.
     20
     21        * page/DOMWindow.cpp:
     22        (WebCore::DOMWindow::willDetachDocumentFromFrame):
     23
    1242019-03-18  Zalan Bujtas  <zalan@apple.com>
    225
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r242960 r243104  
    486486    if (m_performance)
    487487        m_performance->clearResourceTimings();
     488
     489    JSDOMWindowBase::fireFrameClearedWatchpointsForWindow(this);
     490    InspectorInstrumentation::frameWindowDiscarded(*frame(), this);
    488491}
    489492
Note: See TracChangeset for help on using the changeset viewer.