Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: Source/core/html/FormDataList.cpp

Issue 57483002: Implement File constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed most feedback. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/fileapi/FileReader.cpp ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileReader.cpp ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698