REGRESSION (r167635): Reference leak in NetworkResourceLoader while loads are being...
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jun 2014 06:31:11 +0000 (06:31 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jun 2014 06:31:11 +0000 (06:31 +0000)
<https://webkit.org/b/133894>
<rdar://problem/17312299>

Don't self-ref() in start() until we actually start; if page loads are being
deferred, start() will be called again once deferral stops.

This was causing us to leak the entire NetworkResourceLoader object graph.

Reviewed by Brady Eidson.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

index 41e3fbf..127749e 100644 (file)
@@ -1,3 +1,19 @@
+2014-06-13  Andreas Kling  <akling@apple.com>
+
+        REGRESSION (r167635): Reference leak in NetworkResourceLoader while loads are being deferred.
+        <https://webkit.org/b/133894>
+        <rdar://problem/17312299>
+
+        Don't self-ref() in start() until we actually start; if page loads are being
+        deferred, start() will be called again once deferral stops.
+
+        This was causing us to leak the entire NetworkResourceLoader object graph.
+
+        Reviewed by Brady Eidson.
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::start):
+
 2014-06-13  Dan Bernstein  <mitz@apple.com>
 
         Make GenericCallback variadic
index 7908440..c419a35 100644 (file)
@@ -121,17 +121,17 @@ void NetworkResourceLoader::start()
 {
     ASSERT(RunLoop::isMain());
 
+    if (m_defersLoading) {
+        m_deferredRequest = m_request;
+        return;
+    }
+
     // Explicit ref() balanced by a deref() in NetworkResourceLoader::cleanup()
     ref();
 
     // FIXME (NetworkProcess): Set platform specific settings.
     m_networkingContext = RemoteNetworkingContext::create(m_sessionID, m_shouldClearReferrerOnHTTPSToHTTPRedirect);
 
-    if (m_defersLoading) {
-        m_deferredRequest = m_request;
-        return;
-    }
-
     consumeSandboxExtensions();
 
     // FIXME (NetworkProcess): Pass an actual value for defersLoading