[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)
commite84dc344c4a7bf975b2dae7b7d9709844c3c3f0a
tree23e047f5cdf6952739b6f924b1944b5f4eb9593b
parent2ee568d6a20e1fabee1e68cb177959ebb5efc199
[Soup] utilize multipart/x-mixed-replace support recently added to libsoup
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