Title: [207441] trunk/Source/WebKit2
Revision
207441
Author
cdu...@apple.com
Date
2016-10-17 16:27:36 -0700 (Mon, 17 Oct 2016)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (207440 => 207441)


--- trunk/Source/WebKit2/ChangeLog	2016-10-17 23:00:47 UTC (rev 207440)
+++ trunk/Source/WebKit2/ChangeLog	2016-10-17 23:27:36 UTC (rev 207441)
@@ -1,3 +1,28 @@
+2016-10-17  Chris Dumez  <cdu...@apple.com>
+
+        [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:
+
 2016-10-17  Jeremy Jones  <jere...@apple.com>
 
         Enable keyboard in fullscreen.

Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (207440 => 207441)


--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp	2016-10-17 23:00:47 UTC (rev 207440)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp	2016-10-17 23:27:36 UTC (rev 207441)
@@ -204,7 +204,9 @@
         , m_mainResourceKey(mainResourceKey)
         , m_loadCompletionHandler(WTFMove(loadCompletionHandler))
         , m_loadHysteresisActivity([this](HysteresisState state) { if (state == HysteresisState::Stopped) markLoadAsCompleted(); })
-    { }
+    {
+        m_loadHysteresisActivity.impulse();
+    }
 
     void saveToDiskIfReady()
     {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to