summaryrefslogtreecommitdiffstats
path: root/webkit/api/public/WebURLRequest.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-30 21:16:51 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-30 21:16:51 +0000
commit35cb9e1d4ad928a981a305a8f1d1d805c65e0cd5 (patch)
treeff56ff6e26a5a926bfaeb080c6c5bea124c2a87a /webkit/api/public/WebURLRequest.h
parent335fb4f3221673af83ecae7414b666bfecf42e2b (diff)
downloadchromium_src-35cb9e1d4ad928a981a305a8f1d1d805c65e0cd5.zip
chromium_src-35cb9e1d4ad928a981a305a8f1d1d805c65e0cd5.tar.gz
chromium_src-35cb9e1d4ad928a981a305a8f1d1d805c65e0cd5.tar.bz2
Start using WebURLLoader, et. al. from the WebKit API.
Moves our ResourceHandle to webkit/api/src/ResourceHandle.cpp from webkit/glue/resource_handle_impl.cc. A portion of resource_handle_impl.cc was moved into weburlloader_impl.{h,cc}, which now contains our implementation of WebURLLoader. The annoying parts of this CL involve WebPluginImpl. I had to convert it over to using WebURLLoader instead of ResourceHandle so that MultipartResourceDelegate can be shared. There is some complexity in WebURLRequest / WebURLResponse to make it cheap to wrap a ResourceRequest / ResourceResponse. I think this is worth it since there is a lot of conversion between the two types. BUG=10038 TEST=covered by existing tests R=dglazkov Review URL: http://codereview.chromium.org/113928 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/public/WebURLRequest.h')
-rw-r--r--webkit/api/public/WebURLRequest.h78
1 files changed, 49 insertions, 29 deletions
diff --git a/webkit/api/public/WebURLRequest.h b/webkit/api/public/WebURLRequest.h
index c7b9bec..8399624 100644
--- a/webkit/api/public/WebURLRequest.h
+++ b/webkit/api/public/WebURLRequest.h
@@ -31,14 +31,17 @@
#ifndef WebURLRequest_h
#define WebURLRequest_h
-#error "This header file is still a work in progress; do not include!"
-
#include "WebCommon.h"
#include "WebHTTPBody.h"
+#if defined(WEBKIT_IMPLEMENTATION)
+namespace WebCore { struct ResourceRequest; }
+#endif
+
namespace WebKit {
class WebCString;
class WebHTTPBody;
+ class WebHTTPHeaderVisitor;
class WebString;
class WebURL;
class WebURLRequestPrivate;
@@ -66,58 +69,75 @@ namespace WebKit {
WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
WebURLRequest& operator=(const WebURLRequest& r) { assign(r); return *this; }
+ explicit WebURLRequest(const WebURL& url) : m_private(0)
+ {
+ initialize();
+ setURL(url);
+ }
+
WEBKIT_API void initialize();
WEBKIT_API void reset();
WEBKIT_API void assign(const WebURLRequest&);
bool isNull() const { return m_private == 0; }
- WEBKIT_API WebURL url() const = 0;
- WEBKIT_API void setURL(const WebURL&) = 0;
+ WEBKIT_API WebURL url() const;
+ WEBKIT_API void setURL(const WebURL&);
// Used to implement third-party cookie blocking.
- WEBKIT_API WebURL firstPartyForCookies() const = 0;
- WEBKIT_API void setFirstPartyForCookies(const WebURL&) = 0;
+ WEBKIT_API WebURL firstPartyForCookies() const;
+ WEBKIT_API void setFirstPartyForCookies(const WebURL&);
+
+ WEBKIT_API CachePolicy cachePolicy() const;
+ WEBKIT_API void setCachePolicy(CachePolicy);
- WEBKIT_API CachePolicy cachePolicy() const = 0;
- WEBKIT_API void setCachePolicy(CachePolicy) = 0;
+ WEBKIT_API WebString httpMethod() const;
+ WEBKIT_API void setHTTPMethod(const WebString&);
- WEBKIT_API WebString httpMethod() const = 0;
- WEBKIT_API void setHTTPMethod(const WebString&) = 0;
+ WEBKIT_API WebString httpHeaderField(const WebString& name) const;
+ WEBKIT_API void setHTTPHeaderField(const WebString& name, const WebString& value);
+ WEBKIT_API void addHTTPHeaderField(const WebString& name, const WebString& value);
+ WEBKIT_API void clearHTTPHeaderField(const WebString& name);
+ WEBKIT_API void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const;
- WEBKIT_API WebString httpHeaderField(const WebString& name) const = 0;
- WEBKIT_API void setHTTPHeaderField(const WebString& name, const WebString& value) = 0;
- WEBKIT_API void addHTTPHeaderField(const WebString& name, const WebString& value) = 0;
- WEBKIT_API void clearHTTPHeaderField(const WebString& name) = 0;
+ WEBKIT_API const WebHTTPBody& httpBody() const;
+ WEBKIT_API void setHTTPBody(const WebHTTPBody&);
- WEBKIT_API bool hasHTTPBody() const = 0;
- WEBKIT_API void httpBody(WebHTTPBody&) const = 0;
- WEBKIT_API void setHTTPBody(const WebHTTPBody&) = 0;
- WEBKIT_API void appendToHTTPBody(const WebHTTPBody::Element&) = 0;
-
// Controls whether upload progress events are generated when a request
// has a body.
- WEBKIT_API bool reportUploadProgress() const = 0;
- WEBKIT_API void setReportUploadProgress(bool) = 0;
+ WEBKIT_API bool reportUploadProgress() const;
+ WEBKIT_API void setReportUploadProgress(bool);
- WEBKIT_API TargetType targetType() const = 0;
- WEBKIT_API void setTargetType(const TargetType&) = 0;
+ WEBKIT_API TargetType targetType() const;
+ WEBKIT_API void setTargetType(TargetType);
// A consumer controlled value intended to be used to identify the
// requestor.
- WEBKIT_API int requestorID() const = 0;
- WEBKIT_API void setRequestorID(int) = 0;
+ WEBKIT_API int requestorID() const;
+ WEBKIT_API void setRequestorID(int);
// A consumer controlled value intended to be used to identify the
// process of the requestor.
- WEBKIT_API int requestorProcessID() const = 0;
- WEBKIT_API void setRequestorProcessID(int) = 0;
+ WEBKIT_API int requestorProcessID() const;
+ WEBKIT_API void setRequestorProcessID(int);
+
+ // Allows the request to be matched up with its app cache context.
+ WEBKIT_API int appCacheContextID() const;
+ WEBKIT_API void setAppCacheContextID(int id);
// A consumer controlled value intended to be used to record opaque
// security info related to this request.
// FIXME: This really doesn't belong here!
- WEBKIT_API WebCString securityInfo() const = 0;
- WEBKIT_API void setSecurityInfo(const WebCString&) = 0;
+ WEBKIT_API WebCString securityInfo() const;
+ WEBKIT_API void setSecurityInfo(const WebCString&);
+
+#if defined(WEBKIT_IMPLEMENTATION)
+ WebCore::ResourceRequest& toMutableResourceRequest();
+ const WebCore::ResourceRequest& toResourceRequest() const;
+#endif
+
+ protected:
+ void assign(WebURLRequestPrivate*);
private:
WebURLRequestPrivate* m_private;