summaryrefslogtreecommitdiffstats
path: root/webkit/api/src/WebURLRequest.cpp
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 04:59:17 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 04:59:17 +0000
commitfd7f2379b27a709bc84e5af24a6097c9c355fc6e (patch)
tree953ce8b34cbbf5655f70731b4de1af007cedb54d /webkit/api/src/WebURLRequest.cpp
parenta106946bf1fbfeb6003510e3c26dd919611fa4fd (diff)
downloadchromium_src-fd7f2379b27a709bc84e5af24a6097c9c355fc6e.zip
chromium_src-fd7f2379b27a709bc84e5af24a6097c9c355fc6e.tar.gz
chromium_src-fd7f2379b27a709bc84e5af24a6097c9c355fc6e.tar.bz2
Switch WebHTTPBody and WebDragData to implement copy-on-write behavior. This
allows me to return a copyable instance of these wrapper classes while preventing a consumer from modifying the WebCore objects being wrapped. A modification will just modify a copy. This is going to be especially helpful when it comes to wrapping HistoryItem. Note how this simplifies WebURLRequest a bit since it doesn't have to carry a WebHTTPBody member. The copy-on-write behavior is implemented in an ensureMutable method. This CL depends on https://bugs.webkit.org/show_bug.cgi?id=26622 BUG=none TEST=none R=dglazkov Review URL: http://codereview.chromium.org/141062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/src/WebURLRequest.cpp')
-rw-r--r--webkit/api/src/WebURLRequest.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/webkit/api/src/WebURLRequest.cpp b/webkit/api/src/WebURLRequest.cpp
index b62206c..6c92e7f 100644
--- a/webkit/api/src/WebURLRequest.cpp
+++ b/webkit/api/src/WebURLRequest.cpp
@@ -147,16 +147,14 @@ void WebURLRequest::visitHTTPHeaderFields(WebHTTPHeaderVisitor* visitor) const
visitor->visitHeader(String(it->first), it->second);
}
-const WebHTTPBody& WebURLRequest::httpBody() const
+WebHTTPBody WebURLRequest::httpBody() const
{
- m_private->m_httpBody.rebind(m_private->m_resourceRequest->httpBody());
- return m_private->m_httpBody;
+ return m_private->m_resourceRequest->httpBody();
}
void WebURLRequest::setHTTPBody(const WebHTTPBody& httpBody)
{
m_private->m_resourceRequest->setHTTPBody(httpBody);
- m_private->m_httpBody.rebind(0); // Free memory of the old body
}
bool WebURLRequest::reportUploadProgress() const