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

Side by Side Diff: Source/core/loader/FormSubmission.cpp

Issue 27537012: Break core/platform/network dependency on core (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.cpp ('k') | Source/core/platform/network/FormData.h » ('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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 formValues.append(pair<String, String>(input->name().string(), i nput->value())); 219 formValues.append(pair<String, String>(input->name().string(), i nput->value()));
220 if (input->isPasswordField() && !input->value().isEmpty()) 220 if (input->isPasswordField() && !input->value().isEmpty())
221 containsPasswordData = true; 221 containsPasswordData = true;
222 } 222 }
223 } 223 }
224 224
225 RefPtr<FormData> formData; 225 RefPtr<FormData> formData;
226 String boundary; 226 String boundary;
227 227
228 if (isMultiPartForm) { 228 if (isMultiPartForm) {
229 formData = FormData::createMultiPart(*(static_cast<FormDataList*>(domFor mData.get())), domFormData->encoding()); 229 formData = domFormData->createMultiPartFormData(domFormData->encoding()) ;
230 boundary = formData->boundary().data(); 230 boundary = formData->boundary().data();
231 } else { 231 } else {
232 formData = FormData::create(*(static_cast<FormDataList*>(domFormData.get ())), domFormData->encoding(), attributes.method() == GetMethod ? FormData::Form URLEncoded : FormData::parseEncodingType(encodingType)); 232 formData = domFormData->createFormData(domFormData->encoding(), attribut es.method() == GetMethod ? FormData::FormURLEncoded : FormData::parseEncodingTyp e(encodingType));
233 if (copiedAttributes.method() == PostMethod && isMailtoForm) { 233 if (copiedAttributes.method() == PostMethod && isMailtoForm) {
234 // Convert the form data into a string that we put into the URL. 234 // Convert the form data into a string that we put into the URL.
235 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); 235 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType);
236 formData = FormData::create(); 236 formData = FormData::create();
237 } 237 }
238 } 238 }
239 239
240 formData->setIdentifier(generateFormDataIdentifier()); 240 formData->setIdentifier(generateFormDataIdentifier());
241 formData->setContainsPasswordData(containsPasswordData); 241 formData->setContainsPasswordData(containsPasswordData);
242 String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document.b aseTarget() : copiedAttributes.target(); 242 String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document.b aseTarget() : copiedAttributes.target();
(...skipping 28 matching lines...) Expand all
271 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 271 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
272 else 272 else
273 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 273 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
274 } 274 }
275 275
276 frameRequest.resourceRequest().setURL(requestURL()); 276 frameRequest.resourceRequest().setURL(requestURL());
277 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ; 277 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ;
278 } 278 }
279 279
280 } 280 }
OLDNEW
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.cpp ('k') | Source/core/platform/network/FormData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698