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

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

Issue 1698883005: Remove internal use of Document::defaultCharset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/network/FormDataEncoder.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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 bool isMultiPartForm = false; 200 bool isMultiPartForm = false;
201 AtomicString encodingType = copiedAttributes.encodingType(); 201 AtomicString encodingType = copiedAttributes.encodingType();
202 202
203 if (copiedAttributes.method() == PostMethod) { 203 if (copiedAttributes.method() == PostMethod) {
204 isMultiPartForm = copiedAttributes.isMultiPartForm(); 204 isMultiPartForm = copiedAttributes.isMultiPartForm();
205 if (isMultiPartForm && isMailtoForm) { 205 if (isMultiPartForm && isMailtoForm) {
206 encodingType = AtomicString("application/x-www-form-urlencoded", Ato micString::ConstructFromLiteral); 206 encodingType = AtomicString("application/x-www-form-urlencoded", Ato micString::ConstructFromLiteral);
207 isMultiPartForm = false; 207 isMultiPartForm = false;
208 } 208 }
209 } 209 }
210 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataEnc oder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.chara cterSet(), document.defaultCharset()); 210 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataEnc oder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.encod ing());
211 FormData* domFormData = FormData::create(dataEncoding.encodingForFormSubmiss ion()); 211 FormData* domFormData = FormData::create(dataEncoding.encodingForFormSubmiss ion());
212 212
213 bool containsPasswordData = false; 213 bool containsPasswordData = false;
214 for (unsigned i = 0; i < form->associatedElements().size(); ++i) { 214 for (unsigned i = 0; i < form->associatedElements().size(); ++i) {
215 FormAssociatedElement* control = form->associatedElements()[i]; 215 FormAssociatedElement* control = form->associatedElements()[i];
216 ASSERT(control); 216 ASSERT(control);
217 HTMLElement& element = toHTMLElement(*control); 217 HTMLElement& element = toHTMLElement(*control);
218 if (!element.isDisabledFormControl()) 218 if (!element.isDisabledFormControl())
219 control->appendToFormData(*domFormData); 219 control->appendToFormData(*domFormData);
220 if (isHTMLInputElement(element)) { 220 if (isHTMLInputElement(element)) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 if (m_boundary.isEmpty()) 274 if (m_boundary.isEmpty())
275 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
276 else 276 else
277 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 277 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
278 } 278 }
279 279
280 frameRequest.resourceRequest().setURL(requestURL()); 280 frameRequest.resourceRequest().setURL(requestURL());
281 } 281 }
282 282
283 } // namespace blink 283 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/network/FormDataEncoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698