| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 formData->m_elements.uncheckedAppend( | 101 formData->m_elements.uncheckedAppend( |
| 102 FormDataElement(e.m_fileSystemURL.copy(), e.m_fileStart, | 102 FormDataElement(e.m_fileSystemURL.copy(), e.m_fileStart, |
| 103 e.m_fileLength, e.m_expectedFileModificationTime)); | 103 e.m_fileLength, e.m_expectedFileModificationTime)); |
| 104 break; | 104 break; |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 return formData.release(); | 107 return formData.release(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void EncodedFormData::appendData(const void* data, size_t size) { | 110 void EncodedFormData::appendData(const void* data, size_t size) { |
| 111 if (m_elements.isEmpty() || m_elements.last().m_type != FormDataElement::data) | 111 if (m_elements.isEmpty() || m_elements.back().m_type != FormDataElement::data) |
| 112 m_elements.append(FormDataElement()); | 112 m_elements.append(FormDataElement()); |
| 113 FormDataElement& e = m_elements.last(); | 113 FormDataElement& e = m_elements.back(); |
| 114 size_t oldSize = e.m_data.size(); | 114 size_t oldSize = e.m_data.size(); |
| 115 e.m_data.grow(oldSize + size); | 115 e.m_data.grow(oldSize + size); |
| 116 memcpy(e.m_data.data() + oldSize, data, size); | 116 memcpy(e.m_data.data() + oldSize, data, size); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void EncodedFormData::appendFile(const String& filename) { | 119 void EncodedFormData::appendFile(const String& filename) { |
| 120 m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, | 120 m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, |
| 121 invalidFileTime())); | 121 invalidFileTime())); |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (!hasOneRef()) | 194 if (!hasOneRef()) |
| 195 return false; | 195 return false; |
| 196 for (auto& element : m_elements) { | 196 for (auto& element : m_elements) { |
| 197 if (!element.isSafeToSendToAnotherThread()) | 197 if (!element.isSafeToSendToAnotherThread()) |
| 198 return false; | 198 return false; |
| 199 } | 199 } |
| 200 return true; | 200 return true; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace blink | 203 } // namespace blink |
| OLD | NEW |