[SOUP] Move default buffer handling from ResourceHandleClient to ResourceHandlesoup
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2013 18:20:16 +0000 (18:20 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2013 18:20:16 +0000 (18:20 +0000)
commit58e62365167a1f669928174f30f56779abe5b8cc
tree9db2b8678ce545e84ba94feea491d41b613f1fdd
parentdd8010cc85c5aed0166afb75b7b92071cfb46949
[SOUP] Move default buffer handling from ResourceHandleClient to ResourceHandlesoup
https://bugs.webkit.org/show_bug.cgi?id=115364

Reviewed by Martin Robinson.

ResourceHandleClient that is cross-platform file is not the right
place for the default ResourceHandle read buffer. We can make
getBuffer return 0 by default and handle it in ResourceHandleSoup,
creating a default buffer when the client doesn't provide one.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::getOrCreateReadBuffer): Adapt to API change.
* platform/network/ResourceHandle.h:
(ResourceHandle): Add ensureReadBuffer().
* platform/network/ResourceHandleClient.cpp:
(WebCore::ResourceHandleClient::~ResourceHandleClient): Remove
soup specific code.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::getOrCreateReadBuffer): Rename
getBuffer() as getOrCreateReadBuffer() and use a reference for the
out parameter instead of a pointer.
(ResourceHandleClient): Remove soup specific code.
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal): Rename
m_buffer and m_bufferSize as m_readBufferPtr and m_readBufferSize
and add m_readBuffer to be used as default read buffer.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::ensureReadBuffer): Helper function to
make usre we have a read buffer before a read operation. It first
checks if the client provides a buffer and if it doesn't it
creates or reuses the default buffer.
(WebCore::redirectSkipCallback): Call ensureReadBuffer() and adapt
to variable name changes.
(WebCore::cleanupSoupRequestOperation): Adapt to variable name
changes.
(WebCore::nextMultipartResponsePartCallback): Call
ensureReadBuffer() and adapt to variable name changes.
(WebCore::sendRequestCallback): Ditto.
(WebCore::readCallback): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleClient.cpp
Source/WebCore/platform/network/ResourceHandleClient.h
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp