diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 00:00:40 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 00:00:40 +0000 |
commit | 7941d41c1fcf138da497b58ee83d7c260fbce88b (patch) | |
tree | 82df4550c20093a1d6af4c9608d85750aca06259 /webkit/glue/weburlrequest.h | |
parent | 1e0f70402b410a9e274e8d23eeab236b43810a00 (diff) | |
download | chromium_src-7941d41c1fcf138da497b58ee83d7c260fbce88b.zip chromium_src-7941d41c1fcf138da497b58ee83d7c260fbce88b.tar.gz chromium_src-7941d41c1fcf138da497b58ee83d7c260fbce88b.tar.bz2 |
Currently, there is no way to access or modify the upload data and/or complete
list of request headers associated with a WebRequest object. The intent is to
access this information from WebViewDelegate::DispositionForNavigationAction().
Remove the HasFormData() method that checked for upload (form) data on the
history item. The HasFormData() method is not currently being called from
anywhere, so changes elsewhere are not required.
Add HasUploadData(), GetUploadData() and SetUploadData() methods to test, get
and set the underlying request upload data as a net::UploadData object. Add
GetHttpHeaders() and SetHttpHeaders() methods to get and set all request headers
using a map of values. Add the SetHttpHeaderValue() method to set the value for
a particular request header.
Patch by Marshall Greenblatt
R=darin
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/weburlrequest.h')
-rw-r--r-- | webkit/glue/weburlrequest.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/webkit/glue/weburlrequest.h b/webkit/glue/weburlrequest.h index 9283376..5903bc2 100644 --- a/webkit/glue/weburlrequest.h +++ b/webkit/glue/weburlrequest.h @@ -5,6 +5,7 @@ #ifndef WEBKIT_GLUE_WEBURLREQUEST_H__ #define WEBKIT_GLUE_WEBURLREQUEST_H__ +#include <map> #include <string> #include "base/basictypes.h" @@ -17,10 +18,16 @@ enum WebRequestCachePolicy { WebRequestReturnCacheDataDontLoad }; +namespace net { +class UploadData; +} + class GURL; class WebRequest { public: + typedef std::map<std::string, std::string> HeaderMap; + // Extra information that is associated with a request. The embedder derives // from this REFERENCE COUNTED class to associated data with a request and // get it back when the page loads. @@ -71,6 +78,19 @@ class WebRequest { // given header was not set in the request, the empty string is returned. virtual std::wstring GetHttpHeaderValue(const std::wstring& field) const = 0; + // Set a value for a header in the request. + virtual void SetHttpHeaderValue(const std::wstring& field, + const std::wstring& value) = 0; + + // Fills a map with all header name/value pairs set in the request. + virtual void GetHttpHeaders(HeaderMap* headers) const = 0; + + // Sets the header name/value pairs for the request from a map. Values set + // using this method replace any pre-existing values with the same name. + // Passing in a blank value will result in a header with a blank value being + // sent as part of the request. + virtual void SetHttpHeaders(const HeaderMap& headers) = 0; + // Helper function for GetHeaderValue to retrieve the referrer. This // referrer is generated automatically by WebKit when navigation events // occur. If there was no referrer (for example, the browser instructed @@ -94,8 +114,15 @@ class WebRequest { virtual std::string GetSecurityInfo() const = 0; virtual void SetSecurityInfo(const std::string& info) = 0; - // Returns true if this request contains history state that has form data. - virtual bool HasFormData() const = 0; + // Returns true if the request has upload data. + virtual bool HasUploadData() const = 0; + + // Returns the request upload data. This object is temporary and should be + // deleted after use. + virtual void GetUploadData(net::UploadData* data) const = 0; + + // Set the request upload data. + virtual void SetUploadData(const net::UploadData& data) = 0; virtual ~WebRequest() { } }; |