| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
| 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
| 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // If we errored out or got no data, we still return a blob, just an emp
ty one. | 306 // If we errored out or got no data, we still return a blob, just an emp
ty one. |
| 307 size_t size = 0; | 307 size_t size = 0; |
| 308 if (m_binaryResponseBuilder) { | 308 if (m_binaryResponseBuilder) { |
| 309 RefPtr<RawData> rawData = RawData::create(); | 309 RefPtr<RawData> rawData = RawData::create(); |
| 310 size = m_binaryResponseBuilder->size(); | 310 size = m_binaryResponseBuilder->size(); |
| 311 rawData->mutableData()->append(m_binaryResponseBuilder->data(), size
); | 311 rawData->mutableData()->append(m_binaryResponseBuilder->data(), size
); |
| 312 blobData->appendData(rawData, 0, BlobDataItem::toEndOfFile); | 312 blobData->appendData(rawData, 0, BlobDataItem::toEndOfFile); |
| 313 blobData->setContentType(responseMIMEType()); // responseMIMEType de
faults to text/xml which may be incorrect. | 313 blobData->setContentType(responseMIMEType()); // responseMIMEType de
faults to text/xml which may be incorrect. |
| 314 m_binaryResponseBuilder.clear(); | 314 m_binaryResponseBuilder.clear(); |
| 315 } | 315 } |
| 316 m_responseBlob = Blob::create(blobData.release(), size); | 316 m_responseBlob = Blob::create(BlobDataHandle::create(blobData.release(),
size)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 return m_responseBlob.get(); | 319 return m_responseBlob.get(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionCode& ec) | 322 ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionCode& ec) |
| 323 { | 323 { |
| 324 if (m_responseTypeCode != ResponseTypeArrayBuffer) { | 324 if (m_responseTypeCode != ResponseTypeArrayBuffer) { |
| 325 ec = INVALID_STATE_ERR; | 325 ec = INVALID_STATE_ERR; |
| 326 return 0; | 326 return 0; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 setRequestHeaderInternal("Content-Type", ""); | 665 setRequestHeaderInternal("Content-Type", ""); |
| 666 } | 666 } |
| 667 } | 667 } |
| 668 | 668 |
| 669 // FIXME: add support for uploading bundles. | 669 // FIXME: add support for uploading bundles. |
| 670 m_requestEntityBody = FormData::create(); | 670 m_requestEntityBody = FormData::create(); |
| 671 if (body->isFile()) | 671 if (body->isFile()) |
| 672 m_requestEntityBody->appendFile(toFile(body)->path()); | 672 m_requestEntityBody->appendFile(toFile(body)->path()); |
| 673 #if ENABLE(BLOB) | 673 #if ENABLE(BLOB) |
| 674 else | 674 else |
| 675 m_requestEntityBody->appendBlob(body->url()); | 675 m_requestEntityBody->appendBlob(body->uuid(), body->blobDataHandle()
); |
| 676 #endif | 676 #endif |
| 677 } | 677 } |
| 678 | 678 |
| 679 createRequest(ec); | 679 createRequest(ec); |
| 680 } | 680 } |
| 681 | 681 |
| 682 void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec) | 682 void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec) |
| 683 { | 683 { |
| 684 if (!initSend(ec)) | 684 if (!initSend(ec)) |
| 685 return; | 685 return; |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 info.addMember(m_responseDocument); | 1343 info.addMember(m_responseDocument); |
| 1344 info.addMember(m_binaryResponseBuilder); | 1344 info.addMember(m_binaryResponseBuilder); |
| 1345 info.addMember(m_responseArrayBuffer); | 1345 info.addMember(m_responseArrayBuffer); |
| 1346 info.addMember(m_lastSendURL); | 1346 info.addMember(m_lastSendURL); |
| 1347 info.addMember(m_eventTargetData); | 1347 info.addMember(m_eventTargetData); |
| 1348 info.addMember(m_progressEventThrottle); | 1348 info.addMember(m_progressEventThrottle); |
| 1349 info.addMember(m_securityOrigin); | 1349 info.addMember(m_securityOrigin); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 } // namespace WebCore | 1352 } // namespace WebCore |
| OLD | NEW |