OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 else | 108 else |
109 contentType = value.blob()->type(); | 109 contentType = value.blob()->type(); |
110 FormDataBuilder::addContentTypeToMultiPartHeader(header, content
Type.latin1()); | 110 FormDataBuilder::addContentTypeToMultiPartHeader(header, content
Type.latin1()); |
111 } | 111 } |
112 | 112 |
113 FormDataBuilder::finishMultiPartHeader(header); | 113 FormDataBuilder::finishMultiPartHeader(header); |
114 | 114 |
115 // Append body | 115 // Append body |
116 formData->appendData(header.data(), header.size()); | 116 formData->appendData(header.data(), header.size()); |
117 if (value.blob()) { | 117 if (value.blob()) { |
118 if (value.blob()->isFile()) { | 118 if (value.blob()->hasBackingFile()) { |
119 File* file = toFile(value.blob()); | 119 File* file = toFile(value.blob()); |
120 // Do not add the file if the path is empty. | 120 // Do not add the file if the path is empty. |
121 if (!file->path().isEmpty()) | 121 if (!file->path().isEmpty()) |
122 formData->appendFile(file->path()); | 122 formData->appendFile(file->path()); |
123 if (!file->fileSystemURL().isEmpty()) | 123 if (!file->fileSystemURL().isEmpty()) |
124 formData->appendFileSystemURL(file->fileSystemURL()); | 124 formData->appendFileSystemURL(file->fileSystemURL()); |
125 } else { | 125 } else { |
126 formData->appendBlob(value.blob()->uuid(), value.blob()->blo
bDataHandle()); | 126 formData->appendBlob(value.blob()->uuid(), value.blob()->blo
bDataHandle()); |
127 } | 127 } |
128 } else { | 128 } else { |
(...skipping 10 matching lines...) Expand all Loading... |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 if (isMultiPartForm) | 142 if (isMultiPartForm) |
143 FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, formData->bou
ndary().data(), true); | 143 FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, formData->bou
ndary().data(), true); |
144 | 144 |
145 formData->appendData(encodedData.data(), encodedData.size()); | 145 formData->appendData(encodedData.data(), encodedData.size()); |
146 } | 146 } |
147 | 147 |
148 } // namespace | 148 } // namespace |
OLD | NEW |