Index: webkit/glue/weburlrequest.h
===================================================================
--- webkit/glue/weburlrequest.h	(revision 2228)
+++ webkit/glue/weburlrequest.h	(working copy)
@@ -6,10 +6,12 @@
 #define WEBKIT_GLUE_WEBURLREQUEST_H__
 
 #include <string>
+#include <map>
 
 #include "base/basictypes.h"
 #include "base/ref_counted.h"
 
+typedef std::map<std::wstring, std::wstring> WebHttpHeaderMap;
 enum WebRequestCachePolicy {
   WebRequestUseProtocolCachePolicy,
   WebRequestReloadIgnoringCacheData,
@@ -71,6 +73,9 @@
   // given header was not set in the request, the empty string is returned.
   virtual std::wstring GetHttpHeaderValue(const std::wstring& field) const = 0;
 
+  // Returns a map of all header name/value pairs set in the request.
+  virtual void GetHttpHeaders(WebHttpHeaderMap* headers) const = 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
@@ -97,6 +102,12 @@
   // Returns true if this request contains history state that has form data.
   virtual bool HasFormData() const = 0;
 
+  // Returns true if the request has form data.
+  virtual bool HasRequestFormData() const = 0;
+
+  // Reads the request form data into the string buffer.
+  virtual void GetRequestFormData(std::string *data) const = 0;
+
   virtual ~WebRequest() { }
 };
 
Index: webkit/glue/weburlrequest_impl.cc
===================================================================
--- webkit/glue/weburlrequest_impl.cc	(revision 2228)
+++ webkit/glue/weburlrequest_impl.cc	(working copy)
@@ -7,8 +7,13 @@
 #include "webkit/glue/glue_serialize.h"
 #include "webkit/glue/glue_util.h"
 
+#pragma warning(push, 0)
+#include "HTTPHeaderMap.h"
+#include "ResourceRequest.h"
+#include "FormData.h"
+#pragma warning(pop)
+
 using WebCore::FrameLoadRequest;
-using WebCore::ResourceRequest;
 using WebCore::ResourceRequestCachePolicy;
 using WebCore::String;
 
@@ -85,6 +90,18 @@
           webkit_glue::StdWStringToString(field)));
 }
 
+void WebRequestImpl::GetHttpHeaders(WebHttpHeaderMap* headers) const {
+  headers->clear();
+
+  const WebCore::HTTPHeaderMap &map = request_.resourceRequest().httpHeaderFields();
+  WebCore::HTTPHeaderMap::const_iterator end = map.end();
+  for (WebCore::HTTPHeaderMap::const_iterator it = map.begin(); it != end; ++it)
+      headers->insert(
+         std::pair<std::wstring, std::wstring>(
+            webkit_glue::StringToStdWString(it->first),
+            webkit_glue::StringToStdWString(it->second)));
+}
+
 std::wstring WebRequestImpl::GetHttpReferrer() const {
   return webkit_glue::StringToStdWString(
       request_.resourceRequest().httpReferrer());
@@ -114,6 +131,25 @@
   return history_item() && history_item()->formData();
 }
 
+bool WebRequestImpl::HasRequestFormData() const {
+  WebCore::FormData *formdata = request_.resourceRequest().httpBody();
+  return formdata && !formdata->isEmpty();
+}
+
+void WebRequestImpl::GetRequestFormData(std::string *data) const {
+  if (!data)
+      return;
+
+  WebCore::FormData *formdata = request_.resourceRequest().httpBody();
+  if (!formdata)
+      return;
+
+  WTF::Vector<char> vec;
+  formdata->flatten(vec);
+
+  data->append(vec.data(), vec.size());
+}
+
 // static
 WebRequest* WebRequest::Create(const GURL& url) {
   return new WebRequestImpl(url);
Index: webkit/glue/weburlrequest_impl.h
===================================================================
--- webkit/glue/weburlrequest_impl.h	(revision 2228)
+++ webkit/glue/weburlrequest_impl.h	(working copy)
@@ -34,12 +34,15 @@
   virtual std::wstring GetHttpMethod() const;
   virtual void SetHttpMethod(const std::wstring& method);
   virtual std::wstring GetHttpHeaderValue(const std::wstring& field) const;
+  virtual void GetHttpHeaders(WebHttpHeaderMap* headers) const;
   virtual std::wstring GetHttpReferrer() const;
   virtual std::string GetHistoryState() const;
   virtual void SetHistoryState(const std::string& value);
   virtual std::string GetSecurityInfo() const;
   virtual void SetSecurityInfo(const std::string& value);
   virtual bool HasFormData() const;
+  virtual bool HasRequestFormData() const;
+  virtual void GetRequestFormData(std::string *data) const;
 
   // WebRequestImpl
   const WebCore::FrameLoadRequest& frame_load_request() const {
