| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "public/platform/WebHTTPBody.h" | 32 #include "public/platform/WebHTTPBody.h" |
| 33 | 33 |
| 34 #include "platform/FileMetadata.h" | 34 #include "platform/FileMetadata.h" |
| 35 #include "platform/network/FormData.h" | 35 #include "platform/network/EncodedFormData.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class WebHTTPBodyPrivate : public FormData { | 39 class WebHTTPBodyPrivate : public EncodedFormData { |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 void WebHTTPBody::initialize() | 42 void WebHTTPBody::initialize() |
| 43 { | 43 { |
| 44 assign(static_cast<WebHTTPBodyPrivate*>(FormData::create().leakRef())); | 44 assign(static_cast<WebHTTPBodyPrivate*>(EncodedFormData::create().leakRef())
); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void WebHTTPBody::reset() | 47 void WebHTTPBody::reset() |
| 48 { | 48 { |
| 49 assign(0); | 49 assign(0); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WebHTTPBody::assign(const WebHTTPBody& other) | 52 void WebHTTPBody::assign(const WebHTTPBody& other) |
| 53 { | 53 { |
| 54 WebHTTPBodyPrivate* p = const_cast<WebHTTPBodyPrivate*>(other.m_private); | 54 WebHTTPBodyPrivate* p = const_cast<WebHTTPBodyPrivate*>(other.m_private); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 bool WebHTTPBody::containsPasswordData() const | 159 bool WebHTTPBody::containsPasswordData() const |
| 160 { | 160 { |
| 161 return m_private->containsPasswordData(); | 161 return m_private->containsPasswordData(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void WebHTTPBody::setContainsPasswordData(bool containsPasswordData) | 164 void WebHTTPBody::setContainsPasswordData(bool containsPasswordData) |
| 165 { | 165 { |
| 166 m_private->setContainsPasswordData(containsPasswordData); | 166 m_private->setContainsPasswordData(containsPasswordData); |
| 167 } | 167 } |
| 168 | 168 |
| 169 WebHTTPBody::WebHTTPBody(const PassRefPtr<FormData>& data) | 169 WebHTTPBody::WebHTTPBody(const PassRefPtr<EncodedFormData>& data) |
| 170 : m_private(static_cast<WebHTTPBodyPrivate*>(data.leakRef())) | 170 : m_private(static_cast<WebHTTPBodyPrivate*>(data.leakRef())) |
| 171 { | 171 { |
| 172 } | 172 } |
| 173 | 173 |
| 174 WebHTTPBody& WebHTTPBody::operator=(const PassRefPtr<FormData>& data) | 174 WebHTTPBody& WebHTTPBody::operator=(const PassRefPtr<EncodedFormData>& data) |
| 175 { | 175 { |
| 176 assign(static_cast<WebHTTPBodyPrivate*>(data.leakRef())); | 176 assign(static_cast<WebHTTPBodyPrivate*>(data.leakRef())); |
| 177 return *this; | 177 return *this; |
| 178 } | 178 } |
| 179 | 179 |
| 180 WebHTTPBody::operator PassRefPtr<FormData>() const | 180 WebHTTPBody::operator PassRefPtr<EncodedFormData>() const |
| 181 { | 181 { |
| 182 return m_private; | 182 return m_private; |
| 183 } | 183 } |
| 184 | 184 |
| 185 void WebHTTPBody::assign(WebHTTPBodyPrivate* p) | 185 void WebHTTPBody::assign(WebHTTPBodyPrivate* p) |
| 186 { | 186 { |
| 187 // p is already ref'd for us by the caller | 187 // p is already ref'd for us by the caller |
| 188 if (m_private) | 188 if (m_private) |
| 189 m_private->deref(); | 189 m_private->deref(); |
| 190 m_private = p; | 190 m_private = p; |
| 191 } | 191 } |
| 192 | 192 |
| 193 void WebHTTPBody::ensureMutable() | 193 void WebHTTPBody::ensureMutable() |
| 194 { | 194 { |
| 195 ASSERT(!isNull()); | 195 ASSERT(!isNull()); |
| 196 if (!m_private->hasOneRef()) | 196 if (!m_private->hasOneRef()) |
| 197 assign(static_cast<WebHTTPBodyPrivate*>(m_private->copy().leakRef())); | 197 assign(static_cast<WebHTTPBodyPrivate*>(m_private->copy().leakRef())); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |