Changeset 207441 in webkit


Ignore:
Timestamp:
Oct 17, 2016 4:27:36 PM (8 years ago)
Author:
Chris Dumez
Message:

[WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
https://bugs.webkit.org/show_bug.cgi?id=163569
<rdar://problem/28810836>

Reviewed by Antti Koivisto.

PendingFrameLoad objects are created to track frame loads and added to
the m_pendingFrameLoads hash map. These objects are supposed to remove
themselves from the hash map once they detect that the page load has
finished by calling PendingFrameLoad::m_loadCompletionHandler().

PendingFrameLoad::m_loadCompletionHandler() is called from
markLoadAsCompleted() when we detect that the page load has finished
via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
on the HysteresisActivity every time a subresource is loaded in the
frame. The issue is that if no subresource is ever loaded, then we
never call impulse() on the HysteresisActivity, which is therefore
never started. If it nevers starts, then it nevers stops and never
calls markLoadAsCompleted(). To address the problem, we now call
impulse() on the HysteresisActivity as soon as we construct it.

  • NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r207439 r207441  
     12016-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
     4        https://bugs.webkit.org/show_bug.cgi?id=163569
     5        <rdar://problem/28810836>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        PendingFrameLoad objects are created to track frame loads and added to
     10        the m_pendingFrameLoads hash map. These objects are supposed to remove
     11        themselves from the hash map once they detect that the page load has
     12        finished by calling PendingFrameLoad::m_loadCompletionHandler().
     13
     14        PendingFrameLoad::m_loadCompletionHandler() is called from
     15        markLoadAsCompleted() when we detect that the page load has finished
     16        via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
     17        on the HysteresisActivity every time a subresource is loaded in the
     18        frame. The issue is that if no subresource is ever loaded, then we
     19        never call impulse() on the HysteresisActivity, which is therefore
     20        never started. If it nevers starts, then it nevers stops and never
     21        calls markLoadAsCompleted(). To address the problem, we now call
     22        impulse() on the HysteresisActivity as soon as we construct it.
     23
     24        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
     25
    1262016-10-17  Jeremy Jones  <jeremyj@apple.com>
    227
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp

    r202148 r207441  
    205205        , m_loadCompletionHandler(WTFMove(loadCompletionHandler))
    206206        , m_loadHysteresisActivity([this](HysteresisState state) { if (state == HysteresisState::Stopped) markLoadAsCompleted(); })
    207     { }
     207    {
     208        m_loadHysteresisActivity.impulse();
     209    }
    208210
    209211    void saveToDiskIfReady()
Note: See TracChangeset for help on using the changeset viewer.