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

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

Issue 176853004: Oilpan: move core/fileapi to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 9 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
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 24 matching lines...) Expand all
35 #include "RuntimeEnabledFeatures.h" 35 #include "RuntimeEnabledFeatures.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/events/Event.h" 37 #include "core/events/Event.h"
38 #include "core/html/DOMFormData.h" 38 #include "core/html/DOMFormData.h"
39 #include "core/html/HTMLFormControlElement.h" 39 #include "core/html/HTMLFormControlElement.h"
40 #include "core/html/HTMLFormElement.h" 40 #include "core/html/HTMLFormElement.h"
41 #include "core/html/HTMLInputElement.h" 41 #include "core/html/HTMLInputElement.h"
42 #include "core/html/parser/HTMLParserIdioms.h" 42 #include "core/html/parser/HTMLParserIdioms.h"
43 #include "core/loader/FrameLoadRequest.h" 43 #include "core/loader/FrameLoadRequest.h"
44 #include "core/loader/FrameLoader.h" 44 #include "core/loader/FrameLoader.h"
45 #include "heap/Handle.h"
45 #include "platform/network/FormData.h" 46 #include "platform/network/FormData.h"
46 #include "platform/network/FormDataBuilder.h" 47 #include "platform/network/FormDataBuilder.h"
47 #include "wtf/CurrentTime.h" 48 #include "wtf/CurrentTime.h"
48 #include "wtf/text/StringBuilder.h" 49 #include "wtf/text/StringBuilder.h"
49 #include "wtf/text/TextEncoding.h" 50 #include "wtf/text/TextEncoding.h"
50 51
51 namespace WebCore { 52 namespace WebCore {
52 53
53 using namespace HTMLNames; 54 using namespace HTMLNames;
54 55
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 AtomicString encodingType = copiedAttributes.encodingType(); 199 AtomicString encodingType = copiedAttributes.encodingType();
199 200
200 if (copiedAttributes.method() == PostMethod) { 201 if (copiedAttributes.method() == PostMethod) {
201 isMultiPartForm = copiedAttributes.isMultiPartForm(); 202 isMultiPartForm = copiedAttributes.isMultiPartForm();
202 if (isMultiPartForm && isMailtoForm) { 203 if (isMultiPartForm && isMailtoForm) {
203 encodingType = AtomicString("application/x-www-form-urlencoded", Ato micString::ConstructFromLiteral); 204 encodingType = AtomicString("application/x-www-form-urlencoded", Ato micString::ConstructFromLiteral);
204 isMultiPartForm = false; 205 isMultiPartForm = false;
205 } 206 }
206 } 207 }
207 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBui lder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.input Encoding(), document.defaultCharset()); 208 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBui lder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.input Encoding(), document.defaultCharset());
208 RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingF orFormSubmission()); 209 RefPtrWillBeRawPtr<DOMFormData> domFormData = DOMFormData::create(dataEncodi ng.encodingForFormSubmission());
209 Vector<pair<String, String> > formValues; 210 Vector<pair<String, String> > formValues;
210 211
211 bool containsPasswordData = false; 212 bool containsPasswordData = false;
212 for (unsigned i = 0; i < form->associatedElements().size(); ++i) { 213 for (unsigned i = 0; i < form->associatedElements().size(); ++i) {
213 FormAssociatedElement* control = form->associatedElements()[i]; 214 FormAssociatedElement* control = form->associatedElements()[i];
214 HTMLElement* element = toHTMLElement(control); 215 HTMLElement* element = toHTMLElement(control);
215 if (!element->isDisabledFormControl()) 216 if (!element->isDisabledFormControl())
216 control->appendFormData(*domFormData, isMultiPartForm); 217 control->appendFormData(*domFormData, isMultiPartForm);
217 if (element->hasTagName(inputTag)) { 218 if (element->hasTagName(inputTag)) {
218 HTMLInputElement* input = toHTMLInputElement(element); 219 HTMLInputElement* input = toHTMLInputElement(element);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 273 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
273 else 274 else
274 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
275 } 276 }
276 277
277 frameRequest.resourceRequest().setURL(requestURL()); 278 frameRequest.resourceRequest().setURL(requestURL());
278 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), AtomicStr ing(m_origin)); 279 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), AtomicStr ing(m_origin));
279 } 280 }
280 281
281 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698