Title: [119107] trunk/Source/WebKit2
Revision
119107
Author
carlo...@webkit.org
Date
2012-05-31 08:29:48 -0700 (Thu, 31 May 2012)

Log Message

[SOUP] WebProcess crashes when a download is started from an existing ResourceHandle
https://bugs.webkit.org/show_bug.cgi?id=87953

Reviewed by Martin Robinson.

The output stream to write the downloaded data is created in the
didReceiveResponse callback of the download client. When a
download is created for an existing ResourceHandle (this happens
for example when policy decision is download), the response has
already been received. In this case we should make sure that the
download client is notified about the response, so that when data
actually arrives the output stream has already been created.

* WebProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::startWithHandle):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (119106 => 119107)


--- trunk/Source/WebKit2/ChangeLog	2012-05-31 15:27:19 UTC (rev 119106)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-31 15:29:48 UTC (rev 119107)
@@ -1,5 +1,23 @@
 2012-05-31  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        [SOUP] WebProcess crashes when a download is started from an existing ResourceHandle
+        https://bugs.webkit.org/show_bug.cgi?id=87953
+
+        Reviewed by Martin Robinson.
+
+        The output stream to write the downloaded data is created in the
+        didReceiveResponse callback of the download client. When a
+        download is created for an existing ResourceHandle (this happens
+        for example when policy decision is download), the response has
+        already been received. In this case we should make sure that the
+        download client is notified about the response, so that when data
+        actually arrives the output stream has already been created.
+
+        * WebProcess/Downloads/soup/DownloadSoup.cpp:
+        (WebKit::Download::startWithHandle):
+
+2012-05-31  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK] Fix webkit_web_view_can_execute_editing_command() API doc
         https://bugs.webkit.org/show_bug.cgi?id=87930
 

Modified: trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp (119106 => 119107)


--- trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp	2012-05-31 15:27:19 UTC (rev 119106)
+++ trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp	2012-05-31 15:29:48 UTC (rev 119107)
@@ -30,6 +30,7 @@
 #include "DataReference.h"
 #include <WebCore/ErrorsGtk.h>
 #include <WebCore/NotImplemented.h>
+#include <WebCore/ResourceHandleInternal.h>
 #include <gio/gio.h>
 #include <glib/gi18n-lib.h>
 #include <wtf/gobject/GOwnPtr.h>
@@ -147,6 +148,10 @@
     resourceHandle->setClient(m_downloadClient.get());
     m_resourceHandle = resourceHandle;
     didStart();
+    // If the handle already got a response, make sure the download client is notified.
+    ResourceHandleInternal* handleInternal = m_resourceHandle->getInternal();
+    if (!handleInternal->m_response.isNull())
+        m_downloadClient->didReceiveResponse(m_resourceHandle.get(), handleInternal->m_response);
 }
 
 void Download::cancel()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to