Title: [187101] trunk/Source/WebCore
Revision
187101
Author
mcatanz...@igalia.com
Date
2015-07-20 23:18:24 -0700 (Mon, 20 Jul 2015)

Log Message

REGRESSION(r184376): [SOUP] Multiple assertions when downloading files
https://bugs.webkit.org/show_bug.cgi?id=147039

Reviewed by Darin Adler.

No new tests; this will be covered once we enable the network process for API tests.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::releaseForDownload): Call RefPtrBase::relaxAdoptionRequirement so
that we don't assert when storing the non-adopted ResourceHandle in a RefPtr. The ref will
be dropped in ResourceHandle::cleanupSoupOperation, which as the comment says should always
run. HOPEFULLY.
(WebCore::ResourceHandle::continueWillSendRequest): Don't assert that client() is nonnull,
because the code clearly expects and handles the case where it is null.
(WebCore::ResourceHandle::continueDidReceiveResponse): Ditto; note that here client() will
always be null for a download.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187100 => 187101)


--- trunk/Source/WebCore/ChangeLog	2015-07-21 06:06:18 UTC (rev 187100)
+++ trunk/Source/WebCore/ChangeLog	2015-07-21 06:18:24 UTC (rev 187101)
@@ -1,3 +1,22 @@
+2015-07-20  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        REGRESSION(r184376): [SOUP] Multiple assertions when downloading files
+        https://bugs.webkit.org/show_bug.cgi?id=147039
+
+        Reviewed by Darin Adler.
+
+        No new tests; this will be covered once we enable the network process for API tests.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::releaseForDownload): Call RefPtrBase::relaxAdoptionRequirement so
+        that we don't assert when storing the non-adopted ResourceHandle in a RefPtr. The ref will
+        be dropped in ResourceHandle::cleanupSoupOperation, which as the comment says should always
+        run. HOPEFULLY.
+        (WebCore::ResourceHandle::continueWillSendRequest): Don't assert that client() is nonnull,
+        because the code clearly expects and handles the case where it is null.
+        (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto; note that here client() will
+        always be null for a download.
+
 2015-07-20  Ada Chan  <adac...@apple.com>
 
         Follow-up to my earlier fix for r147085

Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (187100 => 187101)


--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2015-07-21 06:06:18 UTC (rev 187100)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2015-07-21 06:18:24 UTC (rev 187101)
@@ -1036,14 +1036,15 @@
 RefPtr<ResourceHandle> ResourceHandle::releaseForDownload(ResourceHandleClient* downloadClient)
 {
     // We don't adopt the ref, as it will be released by cleanupSoupRequestOperation, which should always run.
-    RefPtr<ResourceHandle> newHandle = new ResourceHandle(d->m_context.get(), firstRequest(), nullptr, d->m_defersLoading, d->m_shouldContentSniff);
+    ResourceHandle* newHandle = new ResourceHandle(d->m_context.get(), firstRequest(), nullptr, d->m_defersLoading, d->m_shouldContentSniff);
+    newHandle->relaxAdoptionRequirement();
     std::swap(d, newHandle->d);
 
     g_signal_handlers_disconnect_matched(newHandle->d->m_soupMessage.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
-    g_object_set_data(G_OBJECT(newHandle->d->m_soupMessage.get()), "handle", newHandle.get());
+    g_object_set_data(G_OBJECT(newHandle->d->m_soupMessage.get()), "handle", newHandle);
 
     newHandle->d->m_client = downloadClient;
-    continueAfterDidReceiveResponse(newHandle.get());
+    continueAfterDidReceiveResponse(newHandle);
 
     return newHandle;
 }
@@ -1366,15 +1367,13 @@
 
 void ResourceHandle::continueWillSendRequest(const ResourceRequest& request)
 {
-    ASSERT(client());
-    ASSERT(client()->usesAsyncCallbacks());
+    ASSERT(!client() || client()->usesAsyncCallbacks());
     continueAfterWillSendRequest(this, request);
 }
 
 void ResourceHandle::continueDidReceiveResponse()
 {
-    ASSERT(client());
-    ASSERT(client()->usesAsyncCallbacks());
+    ASSERT(!client() || client()->usesAsyncCallbacks());
     continueAfterDidReceiveResponse(this);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to