[Soup] utilize multipart/x-mixed-replace support recently added to libsoup
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2012 15:02:57 +0000 (15:02 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2012 15:02:57 +0000 (15:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=94515

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2012-12-09
Reviewed by Martin Robinson.

.:

* configure.ac: require soup 2.40.0, which adds the new support.

Source/WebCore:

The multipart/x-mixed-replace content type is often used for providing
"push" server support, with each part in the multipart response
replacing the previous one in the rendering. Soup recently acquired
support for multipart/x-mixed replace, which this change utilizes.

Covered by existing multipart/x-mixed-replace tests.

* platform/network/ResourceHandleInternal.h:
(ResourceHandleInternal): add new member to this class, the multipart input stream
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::cleanupSoupRequestOperation): also clear the multipart input stream on
cleanup
(WebCore::nextPartCallback): callback that handles reporting the new response delivered
with the new part, if any; uses the factored out updateFromSoupMessageHeaders method
(WebCore::sendRequestCallback): handle multipart/x-mixed-replace responses by
requesting the next part
(WebCore::readCallback): when reading has finished, request the next part when
handling a multipart/x-mixed-replace response
* platform/network/soup/ResourceResponse.h:
(ResourceResponse): add declaration for new method
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::updateFromSoupMessage): call new updateFromSoupMessageHeaders
method, instead of dealing with the message headers directly
(WebCore::ResourceResponse::updateFromSoupMessageHeaders): new method, factored out from
updateFromSoupMessage, so this same code can be reused for updating responses for
multipart/x-mixed-replace responses parts

Tools:

This change requires a very recent libsoup, so update our jhbuild
requirements.

* gtk/jhbuild.modules: depend on soup version that adds the multipart/x-mixed-replace
support
* efl/jhbuild.modules: ditto

LayoutTests:

* platform/efl/TestExpectations: adjust expectations for tests that now pass.
* platform/gtk/TestExpectations: ditto.
* platform/gtk-wk2/TestExpectations: add missing multipart tests expectations.
* platform/gtk/http/tests/multipart/invalid-image-data-expected.png: new baseline
* platform/gtk/http/tests/multipart/invalid-image-data-expected.txt: ditto.

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

17 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk-wk2/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-expected.png
LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-expected.txt
LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-standalone-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/platform/network/soup/ResourceResponse.h
Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp
Tools/ChangeLog
Tools/efl/jhbuild.modules
Tools/gtk/jhbuild.modules
configure.ac

index 4da5e7b..efc09e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
+
+        [Soup] utilize multipart/x-mixed-replace support recently added to libsoup
+        https://bugs.webkit.org/show_bug.cgi?id=94515
+
+        Reviewed by Martin Robinson.
+
+        * configure.ac: require soup 2.40.0, which adds the new support.
+
 2012-12-10  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] Bring Harfbuzz-ng support to Gtk
index 36f5b3b..aea86ca 100644 (file)
@@ -1,3 +1,16 @@
+2012-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
+
+        [Soup] utilize multipart/x-mixed-replace support recently added to libsoup
+        https://bugs.webkit.org/show_bug.cgi?id=94515
+
+        Reviewed by Martin Robinson.
+
+        * platform/efl/TestExpectations: adjust expectations for tests that now pass.
+        * platform/gtk/TestExpectations: ditto.
+        * platform/gtk-wk2/TestExpectations: add missing multipart tests expectations.
+        * platform/gtk/http/tests/multipart/invalid-image-data-expected.png: new baseline
+        * platform/gtk/http/tests/multipart/invalid-image-data-expected.txt: ditto.
+
 2012-12-10  Zoltan Nyul  <zoltan.nyul@intel.com>
 
         Implement testRunner.setViewModeMediaFeature() in WebKitTestRunner
index 3f34d2d..35b6317 100644 (file)
@@ -87,11 +87,12 @@ canvas/philip/tests/type.prototype.html
 # https://bugs.webkit.org/show_bug.cgi?id=54251
 http/tests/multipart/invalid-image-data-standalone.html
 
-# http/tests/multipart/stop-crash.html fails on GTK and Qt missing multipart/x-mixed-replace support in libsoup
-# https://bugs.webkit.org/show_bug.cgi?id=47060
-http/tests/multipart/stop-crash.html
-http/tests/multipart/load-last-non-html-frame.php
-http/tests/multipart/policy-ignore-crash.php
+# The timeout is caused apparently by the whole process hanging; probably a bug in soup,
+# needs further investigation.
+http/tests/multipart/multipart-wait-before-boundary.html [ Timeout ]
+
+# See http://bugzilla.gnome.org/show_bug.cgi?id=685752
+http/tests/multipart/load-last-non-html-frame.php [ Failure ]
 
 # Failing on non-Chromium bots
 # https://bugs.webkit.org/show_bug.cgi?id=68278
@@ -115,7 +116,7 @@ http/tests/navigation/post-307-response.html
 http/tests/misc/acid2-pixel.html
 
 # BUG: no green in the rectangle
-http/tests/multipart/invalid-image-data.html
+webkit.org/b/54251 http/tests/multipart/invalid-image-data.html [ Skip ]
 
 # BUG: new windows do not have scrollbars
 fast/dom/Window/new-window-opener.html
@@ -362,9 +363,6 @@ webkit.org/b/98257 fast/canvas/webgl/oes-element-index-uint.html [ Failure Pass
 # TESTS EXPECTED TO FAIL
 #////////////////////////////////////////////////////////////////////////////////////////
 
-# Missing support for multipart/x-mixed-replace in libsoup.
-webkit.org/b/94515 http/tests/multipart/multipart-html.php [ Failure ]
-
 # These tests require DASHBOARD_SUPPORT but this feature is specific to Mac port.
 Bug(EFL) fast/canvas/canvas-gradient-addStop-error.html
 Bug(EFL) fast/canvas/fill-stroke-clip-reset-path.html
@@ -656,10 +654,6 @@ webkit.org/b/100519 fast/images/png-with-color-profile.html [ Skip ]
 webkit.org/b/100519 fast/images/paletted-png-with-color-profile.html [ Skip ]
 
 #////////////////////////////////////////////////////////////////////////////////////////
-# CRASHES
-#////////////////////////////////////////////////////////////////////////////////////////
-
-#////////////////////////////////////////////////////////////////////////////////////////
 # FLAKY TESTS
 #////////////////////////////////////////////////////////////////////////////////////////
 
@@ -1385,9 +1379,6 @@ webkit.org/b/89845 fast/forms/input-set-composition-scroll.html [ Failure ]
 
 webkit.org/b/90007 http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html [ Failure ]
 
-# Looks like missing multipart/x-mixed-replace support in libsoup. Failing on both GTK and EFL.
-webkit.org/b/68979 http/tests/multipart/multipart-replace-non-html-content.php [ Failure ]
-
 # These tests are failing after r122528.
 webkit.org/b/91210 http/tests/w3c/webperf/approved/navigation-timing/html/test_performance_attributes_exist_in_object.html [ Failure ]
 webkit.org/b/91210 http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_xserver_redirect.html [ Failure ]
index 3a538c6..7e7ad84 100644 (file)
@@ -458,6 +458,9 @@ Bug(GTK) fast/workers/shared-worker-load-error.html [ Failure ]
 Bug(GTK) fast/writing-mode/Kusa-Makura-background-canvas.html [ Failure ]
 Bug(GTK) http/tests/local/blob/send-hybrid-blob.html [ Failure ]
 Bug(GTK) http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm [ Failure ]
+Bug(GTK) http/tests/multipart/multipart-html.php [ Timeout ]
+Bug(GTK) http/tests/multipart/multipart-replace-non-html-content.php [ Timeout ]
+Bug(GTK) http/tests/multipart/policy-ignore-crash.php [ Failure ]
 Bug(GTK) http/tests/security/cross-origin-xsl-BLOCKED.html [ Failure ]
 Bug(GTK) http/tests/security/cross-origin-xsl-redirect-BLOCKED.html [ Failure ]
 Bug(GTK) http/tests/security/storage-blocking-strengthened-plugin.html [ Failure ]
index e04add7..ba7ad05 100644 (file)
@@ -673,8 +673,6 @@ Bug(GTK) http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-twice.h
 
 webkit.org/b/46644 fast/text/large-text-composed-char-dos.html [ Timeout ]
 
-webkit.org/b/68979 http/tests/multipart/invalid-image-data-standalone.html [ Skip ]
-
 Bug(GTK) http/tests/xmlhttprequest/redirect-cross-origin-tripmine.html [ Skip ]
 
 Bug(GTK) [ Debug ] fast/css/user-drag-none.html [ Timeout ]
@@ -1131,13 +1129,12 @@ webkit.org/b/68855 editing/selection/select-bidi-run.html [ Failure ]
 # This test is out-dated since r95899.
 webkit.org/b/65709 canvas/philip/tests/2d.drawImage.outsidesource.html [ Failure ]
 
-# missing multipart/x-mixed-replace support in libsoup
-webkit.org/b/94515 http/tests/multipart/invalid-image-data.html
-webkit.org/b/94515 http/tests/multipart/load-last-non-html-frame.php [ Failure ]
-webkit.org/b/94515 http/tests/multipart/multipart-replace-non-html-content.php [ Failure ]
-webkit.org/b/94515 http/tests/multipart/policy-ignore-crash.php [ Failure ]
-webkit.org/b/94515 http/tests/multipart/stop-crash.html [ Skip ]
-webkit.org/b/94515 http/tests/multipart/multipart-html.php [ Failure ]
+# The timeout is caused apparently by the whole process hanging; probably a bug in soup,
+# needs further investigation.
+Bug(GTK) http/tests/multipart/multipart-wait-before-boundary.html [ Timeout ]
+
+# Does not render the rectangle as it should, even though the multiple parts seem to work
+webkit.org/b/54251 http/tests/multipart/invalid-image-data.html [ Skip ]
 
 # Fails because it does not throw a couple of expected exceptions
 Bug(GTK) http/tests/local/fileapi/send-sliced-dragged-file.html [ Failure ]
index d7a0241..1addc83 100644 (file)
Binary files a/LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-expected.png and b/LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-expected.png differ
index 6c6d492..3f687da 100644 (file)
@@ -1,4 +1,3 @@
-FAIL: Timed out waiting for notifyDone to be called
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
diff --git a/LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-standalone-expected.txt b/LayoutTests/platform/gtk/http/tests/multipart/invalid-image-data-standalone-expected.txt
new file mode 100644 (file)
index 0000000..129aa3d
--- /dev/null
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 53x19
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 776x37
+          RenderInline {A} at (0,0) size 301x19 [color=#0000EE]
+            RenderText {#text} at (53,0) size 301x19
+              text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13759"
+          RenderText {#text} at (354,0) size 776x37
+            text run at (354,0) width 4: " "
+            text run at (358,0) width 418: "REGRESSION (r20182-r20184): Incorrect rendering of multipart"
+            text run at (0,18) width 45: "images"
+        RenderText {#text} at (45,18) size 4x19
+          text run at (45,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 244x19
+          text run at (0,0) width 244: "There should be a green square below."
+      RenderBlock (anonymous) at (0,86) size 784x124
+        RenderPartObject {IFRAME} at (0,0) size 124x124 [border: (2px inset #000000)]
+          layer at (0,0) size 120x120
+            RenderView at (0,0) size 120x120
+          layer at (0,0) size 120x120
+            RenderBlock {HTML} at (0,0) size 120x120
+              RenderBody {BODY} at (0,0) size 120x120
+                RenderImage {IMG} at (0,0) size 100x100
+        RenderText {#text} at (0,0) size 0x0
index 11bb6b9..02b0746 100644 (file)
@@ -1,3 +1,37 @@
+2012-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
+
+        [Soup] utilize multipart/x-mixed-replace support recently added to libsoup
+        https://bugs.webkit.org/show_bug.cgi?id=94515
+
+        Reviewed by Martin Robinson.
+
+        The multipart/x-mixed-replace content type is often used for providing
+        "push" server support, with each part in the multipart response
+        replacing the previous one in the rendering. Soup recently acquired
+        support for multipart/x-mixed replace, which this change utilizes.
+
+        Covered by existing multipart/x-mixed-replace tests.
+
+        * platform/network/ResourceHandleInternal.h:
+        (ResourceHandleInternal): add new member to this class, the multipart input stream
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::cleanupSoupRequestOperation): also clear the multipart input stream on
+        cleanup
+        (WebCore::nextPartCallback): callback that handles reporting the new response delivered
+        with the new part, if any; uses the factored out updateFromSoupMessageHeaders method
+        (WebCore::sendRequestCallback): handle multipart/x-mixed-replace responses by
+        requesting the next part
+        (WebCore::readCallback): when reading has finished, request the next part when
+        handling a multipart/x-mixed-replace response
+        * platform/network/soup/ResourceResponse.h:
+        (ResourceResponse): add declaration for new method
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponse::updateFromSoupMessage): call new updateFromSoupMessageHeaders
+        method, instead of dealing with the message headers directly
+        (WebCore::ResourceResponse::updateFromSoupMessageHeaders): new method, factored out from
+        updateFromSoupMessage, so this same code can be reused for updating responses for
+        multipart/x-mixed-replace responses parts
+
 2012-12-10  Zoltan Nyul  <zoltan.nyul@intel.com>
 
         Implement testRunner.setViewModeMediaFeature() in WebKitTestRunner
index 03ad491..b7f6c95 100644 (file)
 #endif
 
 #if USE(SOUP)
-#include <wtf/gobject/GRefPtr.h>
 #define LIBSOUP_USE_UNSTABLE_REQUEST_API
+#include <libsoup/soup-multipart-input-stream.h>
 #include <libsoup/soup-request.h>
 #include <libsoup/soup.h>
+#include <wtf/gobject/GRefPtr.h>
 class Frame;
 #endif
 
@@ -192,6 +193,7 @@ namespace WebCore {
         bool m_cancelled;
         GRefPtr<SoupRequest> m_soupRequest;
         GRefPtr<GInputStream> m_inputStream;
+        GRefPtr<SoupMultipartInputStream> m_multipartInputStream;
         GRefPtr<GCancellable> m_cancellable;
         GRefPtr<GAsyncResult> m_deferredResult;
         GRefPtr<GSource> m_timeoutSource;
index a5ff90e..1d9210a 100644 (file)
@@ -53,6 +53,7 @@
 #include <gio/gio.h>
 #include <glib.h>
 #define LIBSOUP_USE_UNSTABLE_REQUEST_API
+#include <libsoup/soup-multipart-input-stream.h>
 #include <libsoup/soup-request-http.h>
 #include <libsoup/soup-requester.h>
 #include <libsoup/soup.h>
@@ -443,12 +444,9 @@ static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroyin
 {
     ResourceHandleInternal* d = handle->getInternal();
 
-    if (d->m_soupRequest)
-        d->m_soupRequest.clear();
-
-    if (d->m_inputStream)
-        d->m_inputStream.clear();
-
+    d->m_soupRequest.clear();
+    d->m_inputStream.clear();
+    d->m_multipartInputStream.clear();
     d->m_cancellable.clear();
 
     if (d->m_soupMessage) {
@@ -493,7 +491,50 @@ static bool handleUnignoredTLSErrors(ResourceHandle* handle)
     return true;
 }
 
-static void sendRequestCallback(GObject*, GAsyncResult* res, gpointer data)
+static void nextMultipartResponsePartCallback(GObject* source, GAsyncResult* result, gpointer data)
+{
+    RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
+
+    ResourceHandleInternal* d = handle->getInternal();
+    ResourceHandleClient* client = handle->client();
+
+    if (d->m_cancelled || !client) {
+        cleanupSoupRequestOperation(handle.get());
+        return;
+    }
+
+    ASSERT(!d->m_inputStream);
+
+    GOwnPtr<GError> error;
+    d->m_inputStream = adoptGRef(soup_multipart_input_stream_next_part_finish(d->m_multipartInputStream.get(), result, &error.outPtr()));
+    if (error) {
+        client->didFail(handle.get(), ResourceError::httpError(d->m_soupMessage.get(), error.get(), d->m_soupRequest.get()));
+        cleanupSoupRequestOperation(handle.get());
+        return;
+    }
+
+    if (!d->m_inputStream) {
+        client->didFinishLoading(handle.get(), 0);
+        cleanupSoupRequestOperation(handle.get());
+        return;
+    }
+
+    d->m_response = ResourceResponse();
+    d->m_response.setURL(handle->firstRequest().url());
+    d->m_response.updateFromSoupMessageHeaders(soup_multipart_input_stream_get_headers(d->m_multipartInputStream.get()));
+
+    client->didReceiveResponse(handle.get(), d->m_response);
+
+    if (d->m_cancelled || !client) {
+        cleanupSoupRequestOperation(handle.get());
+        return;
+    }
+
+    g_input_stream_read_async(d->m_inputStream.get(), d->m_buffer, READ_BUFFER_SIZE,
+        G_PRIORITY_DEFAULT, d->m_cancellable.get(), readCallback, handle.get());
+}
+
+static void sendRequestCallback(GObject*, GAsyncResult* result, gpointer data)
 {
     RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
 
@@ -507,19 +548,18 @@ static void sendRequestCallback(GObject*, GAsyncResult* res, gpointer data)
     }
 
     if (d->m_defersLoading) {
-        d->m_deferredResult = res;
+        d->m_deferredResult = result;
         return;
     }
 
     GOwnPtr<GError> error;
-    GInputStream* in = soup_request_send_finish(d->m_soupRequest.get(), res, &error.outPtr());
+    GRefPtr<GInputStream> inputStream = adoptGRef(soup_request_send_finish(d->m_soupRequest.get(), result, &error.outPtr()));
     if (error) {
         client->didFail(handle.get(), ResourceError::httpError(soupMessage, error.get(), d->m_soupRequest.get()));
         cleanupSoupRequestOperation(handle.get());
         return;
     }
 
-    d->m_inputStream = adoptGRef(in);
     d->m_buffer = static_cast<char*>(g_slice_alloc(READ_BUFFER_SIZE));
 
     if (soupMessage) {
@@ -549,6 +589,14 @@ static void sendRequestCallback(GObject*, GAsyncResult* res, gpointer data)
         return;
     }
 
+    if (soupMessage && d->m_response.isMultipart()) {
+        d->m_multipartInputStream = adoptGRef(soup_multipart_input_stream_new(soupMessage, inputStream.get()));
+        soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), G_PRIORITY_DEFAULT,
+            d->m_cancellable.get(), nextMultipartResponsePartCallback, handle.get());
+        return;
+    }
+
+    d->m_inputStream = inputStream;
     g_input_stream_read_async(d->m_inputStream.get(), d->m_buffer, READ_BUFFER_SIZE,
                               G_PRIORITY_DEFAULT, d->m_cancellable.get(), readCallback, handle.get());
 }
@@ -1190,6 +1238,14 @@ static void readCallback(GObject*, GAsyncResult* asyncResult, gpointer data)
     }
 
     if (!bytesRead) {
+        // If this is a multipart message, we'll look for another part.
+        if (d->m_soupMessage && d->m_multipartInputStream) {
+            d->m_inputStream.clear();
+            soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), G_PRIORITY_DEFAULT,
+                d->m_cancellable.get(), nextMultipartResponsePartCallback, handle.get());
+            return;
+        }
+
         // We inform WebCore of load completion now instead of waiting for the input
         // stream to close because the input stream is closed asynchronously. If this
         // is a synchronous request, we wait until the closeCallback, because we don't
index b8084cf..93f7da3 100644 (file)
@@ -58,7 +58,8 @@ public:
     }
 
     SoupMessage* toSoupMessage() const;
-    void updateFromSoupMessage(SoupMessage* soupMessage);
+    void updateFromSoupMessage(SoupMessage*);
+    void updateFromSoupMessageHeaders(const SoupMessageHeaders*);
 
     SoupMessageFlags soupMessageFlags() const { return m_soupFlags; }
     void setSoupMessageFlags(SoupMessageFlags soupFlags) { m_soupFlags = soupFlags; }
index fe0b5fb..6d298d4 100644 (file)
@@ -63,7 +63,20 @@ void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
     m_url = soupURIToKURL(soup_message_get_uri(soupMessage));
 
     m_httpStatusCode = soupMessage->status_code;
+    setHTTPStatusText(soupMessage->reason_phrase);
+
+    m_soupFlags = soup_message_get_flags(soupMessage);
+
+    GTlsCertificate* certificate = 0;
+    soup_message_get_https_status(soupMessage, &certificate, &m_tlsErrors);
+    m_certificate = certificate;
+
+    updateFromSoupMessageHeaders(soupMessage->response_headers);
+}
 
+void ResourceResponse::updateFromSoupMessageHeaders(const SoupMessageHeaders* messageHeaders)
+{
+    SoupMessageHeaders* headers = const_cast<SoupMessageHeaders*>(messageHeaders);
     SoupMessageHeadersIter headersIter;
     const char* headerName;
     const char* headerValue;
@@ -72,7 +85,7 @@ void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
     // thus, we need to clear old header values and update m_httpHeaderFields from soupMessage headers.
     m_httpHeaderFields.clear();
 
-    soup_message_headers_iter_init(&headersIter, soupMessage->response_headers);
+    soup_message_headers_iter_init(&headersIter, headers);
     while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue)) {
         String headerNameString = String::fromUTF8WithLatin1Fallback(headerName, strlen(headerName));
         HTTPHeaderMap::const_iterator it = m_httpHeaderFields.find(headerNameString);
@@ -87,10 +100,8 @@ void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
         }
     }
 
-    m_soupFlags = soup_message_get_flags(soupMessage);
-
     String contentType;
-    const char* officialType = soup_message_headers_get_one(soupMessage->response_headers, "Content-Type");
+    const char* officialType = soup_message_headers_get_one(headers, "Content-Type");
     if (!m_sniffedContentType.isEmpty() && m_sniffedContentType != officialType)
         contentType = m_sniffedContentType;
     else
@@ -98,13 +109,7 @@ void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
     setMimeType(extractMIMETypeFromMediaType(contentType));
     setTextEncodingName(extractCharsetFromMediaType(contentType));
 
-    setExpectedContentLength(soup_message_headers_get_content_length(soupMessage->response_headers));
-    setHTTPStatusText(soupMessage->reason_phrase);
-    setSuggestedFilename(filenameFromHTTPContentDisposition(httpHeaderField("Content-Disposition")));
-
-    GTlsCertificate* certificate = 0;
-    soup_message_get_https_status(soupMessage, &certificate, &m_tlsErrors);
-    m_certificate = certificate;
-}
+    setExpectedContentLength(soup_message_headers_get_content_length(headers));
+    setSuggestedFilename(filenameFromHTTPContentDisposition(httpHeaderField("Content-Disposition")));}
 
 }
index c183b0d..69c35ea 100644 (file)
@@ -1,3 +1,17 @@
+2012-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
+
+        [Soup] utilize multipart/x-mixed-replace support recently added to libsoup
+        https://bugs.webkit.org/show_bug.cgi?id=94515
+
+        Reviewed by Martin Robinson.
+
+        This change requires a very recent libsoup, so update our jhbuild
+        requirements.
+
+        * gtk/jhbuild.modules: depend on soup version that adds the multipart/x-mixed-replace
+        support
+        * efl/jhbuild.modules: ditto
+
 2012-12-10  Zoltan Nyul  <zoltan.nyul@intel.com>
 
         Implement testRunner.setViewModeMediaFeature() in WebKitTestRunner
index 07a248e..f15024d 100644 (file)
     <dependencies>
       <dep package="glib-networking"/>
     </dependencies>
-    <branch module="/pub/gnome/sources/libsoup/2.39/libsoup-2.39.4.1.tar.xz" version="2.39.4.1"
+    <branch module="/pub/gnome/sources/libsoup/2.40/libsoup-2.40.0.tar.xz" version="2.40.0"
             repo="ftp.gnome.org"
-            hash="sha256:0740c3f6e393d31f87f166f0c6d11de5ebaa013d382c59ed924a1384c575612e"
-            md5sum="895ed1e0c949a2ce50aeaeb58661bfc3"/>
+            hash="sha256:ef65eb6d48e9525ad0fb82f964d3001e86921330317b51082d3dd0afc41d2ea9"
+            md5sum="4d66366e08271e22aef164ec4d74e5f0"/>
   </autotools>
 
   <autotools id="fontconfig" autogen-sh="configure">
index f23f5b0..ed5f115 100644 (file)
     <dependencies>
       <dep package="glib-networking"/>
     </dependencies>
-    <branch module="libsoup" version="2.39.2"
-            repo="git.gnome.org"
-            tag="LIBSOUP_2_39_2"/>
+    <branch module="/pub/gnome/sources/libsoup/2.40/libsoup-2.40.1.tar.xz" version="2.40.1"
+            repo="ftp.gnome.org"
+            hash="sha256:77a55d57e7e8055acd2f44e0cc889b9ba48052e8b7f07e829157d57417ac650a"
+            md5sum="2fa30bab92d770eeb6535e1504ab2ded"/>
   </autotools>
 
   <autotools id="fontconfig" autogen-sh="configure">
index 8544196..7d0225a 100644 (file)
@@ -373,7 +373,7 @@ CAIRO_REQUIRED_VERSION=1.10
 FONTCONFIG_REQUIRED_VERSION=2.4
 FREETYPE2_REQUIRED_VERSION=9.0
 GLIB_REQUIRED_VERSION=2.32.0
-LIBSOUP_REQUIRED_VERSION=2.39.2
+LIBSOUP_REQUIRED_VERSION=2.40.0
 LIBXML_REQUIRED_VERSION=2.6
 PANGO_REQUIRED_VERSION=1.21.0