diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 21:09:28 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 21:09:28 +0000 |
commit | 726985e24233bdfd13d2fcee05100ce19fb85525 (patch) | |
tree | 7e16dc159f929577c80f0cf993b5ec51ffc3217d /webkit/api/src/WrappedResourceResponse.h | |
parent | a3f0c997f88517619709282f70fbf5e27942cdae (diff) | |
download | chromium_src-726985e24233bdfd13d2fcee05100ce19fb85525.zip chromium_src-726985e24233bdfd13d2fcee05100ce19fb85525.tar.gz chromium_src-726985e24233bdfd13d2fcee05100ce19fb85525.tar.bz2 |
Delete files from webkit/glue that have been made obsolete by corresponding
files in webkit/api.
Here's the mapping:
webkit/glue/webdatasource.h -> webkit/api/public/WebDataSource.h
webkit/glue/weberror.h -> webkit/api/public/WebURLError.h
webkit/glue/weburlrequest.h -> webkit/api/public/WebURLRequest.h
webkit/glue/webresponse.h -> webkit/api/public/WebURLResponse.h
I kept the implementation of WebDataSource in webkit/glue for now because it
helps to have it close to WebFrameImpl and WebFrameLoaderClient.
To facilitate this change, I needed to make use of WrappedResourceRequest and
WrappedResourceResponse from webkit/api/src within the implementation files of
webkit/glue. This is only a temporary usage of webkit/api/src from the
outside. It will go away when WebFrame, etc. get moved into webkit/api.
I modified these wrapper classes to expose the 'bind' function so that I can
re-bind a wrapper. This is used in WebDataSourceImpl::request() and related
methods to allow the interface to return a const reference to a WebURLRequest
and WebURLResponse.
The changes here are fairly mechanical. I'm not too happy about the way
WebDataSource::redirectChain now works. I would prefer a solution that didn't
involve so much copying, but I'm not going to worry about optimizing that now.
R=brettw
BUG=10041
TEST=none
Review URL: http://codereview.chromium.org/126286
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/src/WrappedResourceResponse.h')
-rw-r--r-- | webkit/api/src/WrappedResourceResponse.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/webkit/api/src/WrappedResourceResponse.h b/webkit/api/src/WrappedResourceResponse.h index fe7bb99..8c44315 100644 --- a/webkit/api/src/WrappedResourceResponse.h +++ b/webkit/api/src/WrappedResourceResponse.h @@ -28,7 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "WebURLResponse.h" +#ifndef WrappedResourceResponse_h +#define WrappedResourceResponse_h + +// FIXME: This relative path is a temporary hack to support using this +// header from webkit/glue. +#include "../public/WebURLResponse.h" #include "WebURLResponsePrivate.h" namespace WebKit { @@ -40,23 +45,31 @@ namespace WebKit { reset(); // Need to drop reference to m_handle } + WrappedResourceResponse() { } + WrappedResourceResponse(WebCore::ResourceResponse& resourceResponse) { - bind(&resourceResponse); + bind(resourceResponse); } WrappedResourceResponse(const WebCore::ResourceResponse& resourceResponse) { - bind(const_cast<WebCore::ResourceResponse*>(&resourceResponse)); + bind(resourceResponse); } - private: - void bind(WebCore::ResourceResponse* resourceResponse) + void bind(WebCore::ResourceResponse& resourceResponse) { - m_handle.m_resourceResponse = resourceResponse; + m_handle.m_resourceResponse = &resourceResponse; assign(&m_handle); } + void bind(const WebCore::ResourceResponse& resourceResponse) + { + m_handle.m_resourceResponse = const_cast<WebCore::ResourceResponse*>(&resourceResponse); + assign(&m_handle); + } + + private: class Handle : public WebURLResponsePrivate { public: virtual void dispose() { m_resourceResponse = 0; } @@ -66,3 +79,5 @@ namespace WebKit { }; } // namespace WebKit + +#endif |