Title: [213206] trunk/Source/WebKit2
Revision
213206
Author
carlo...@webkit.org
Date
2017-02-28 23:34:15 -0800 (Tue, 28 Feb 2017)

Log Message

NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
https://bugs.webkit.org/show_bug.cgi?id=168963

Reviewed by Antti Koivisto.

This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
by didComplete(), and the willSendRequest completion handler does nothing when the request is null.

* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (213205 => 213206)


--- trunk/Source/WebKit2/ChangeLog	2017-03-01 05:29:32 UTC (rev 213205)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-01 07:34:15 UTC (rev 213206)
@@ -1,3 +1,21 @@
+2017-02-28  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
+        https://bugs.webkit.org/show_bug.cgi?id=168963
+
+        Reviewed by Antti Koivisto.
+
+        This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
+        completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
+        m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
+        ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
+        the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
+        don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
+        by didComplete(), and the willSendRequest completion handler does nothing when the request is null.
+
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
+        (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
+
 2017-02-28  Alexey Proskuryakov  <a...@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=168899

Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (213205 => 213206)


--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2017-03-01 05:29:32 UTC (rev 213205)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2017-03-01 07:34:15 UTC (rev 213206)
@@ -76,14 +76,8 @@
     if (!m_cacheEntry)
         m_cacheEntry = NetworkCache::singleton().makeRedirectEntry(request, redirectResponse, redirectRequest);
 
-    auto load = WTFMove(m_networkLoad);
-
     // Don't follow the redirect. The redirect target will be registered for speculative load when it is loaded.
     didComplete();
-
-    // This causes call to didFailLoading().
-    if (load)
-        load->continueWillSendRequest({ });
 }
 
 auto SpeculativeLoad::didReceiveResponse(ResourceResponse&& receivedResponse) -> ShouldContinueDidReceiveResponse
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to