OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 { | 133 { |
134 m_method = other.m_method; | 134 m_method = other.m_method; |
135 m_isMultiPartForm = other.m_isMultiPartForm; | 135 m_isMultiPartForm = other.m_isMultiPartForm; |
136 | 136 |
137 m_action = other.m_action; | 137 m_action = other.m_action; |
138 m_target = other.m_target; | 138 m_target = other.m_target; |
139 m_encodingType = other.m_encodingType; | 139 m_encodingType = other.m_encodingType; |
140 m_acceptCharset = other.m_acceptCharset; | 140 m_acceptCharset = other.m_acceptCharset; |
141 } | 141 } |
142 | 142 |
143 inline FormSubmission::FormSubmission(Method method, const KURL& action, const S
tring& target, const String& contentType, PassRefPtr<FormState> state, PassRefPt
r<FormData> data, const String& boundary, PassRefPtr<Event> event) | 143 inline FormSubmission::FormSubmission(Method method, const KURL& action, const A
tomicString& target, const String& contentType, PassRefPtr<FormState> state, Pas
sRefPtr<FormData> data, const String& boundary, PassRefPtr<Event> event) |
144 : m_method(method) | 144 : m_method(method) |
145 , m_action(action) | 145 , m_action(action) |
146 , m_target(target) | 146 , m_target(target) |
147 , m_contentType(contentType) | 147 , m_contentType(contentType) |
148 , m_formState(state) | 148 , m_formState(state) |
149 , m_formData(data) | 149 , m_formData(data) |
150 , m_boundary(boundary) | 150 , m_boundary(boundary) |
151 , m_event(event) | 151 , m_event(event) |
152 { | 152 { |
153 } | 153 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 formData = domFormData->createFormData(domFormData->encoding(), attribut
es.method() == GetMethod ? FormData::FormURLEncoded : FormData::parseEncodingTyp
e(encodingType)); | 231 formData = domFormData->createFormData(domFormData->encoding(), attribut
es.method() == GetMethod ? FormData::FormURLEncoded : FormData::parseEncodingTyp
e(encodingType)); |
232 if (copiedAttributes.method() == PostMethod && isMailtoForm) { | 232 if (copiedAttributes.method() == PostMethod && isMailtoForm) { |
233 // Convert the form data into a string that we put into the URL. | 233 // Convert the form data into a string that we put into the URL. |
234 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); | 234 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); |
235 formData = FormData::create(); | 235 formData = FormData::create(); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 formData->setIdentifier(generateFormDataIdentifier()); | 239 formData->setIdentifier(generateFormDataIdentifier()); |
240 formData->setContainsPasswordData(containsPasswordData); | 240 formData->setContainsPasswordData(containsPasswordData); |
241 String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document.b
aseTarget() : copiedAttributes.target(); | 241 AtomicString targetOrBaseTarget = copiedAttributes.target().isEmpty() ? docu
ment.baseTarget() : copiedAttributes.target(); |
242 RefPtr<FormState> formState = FormState::create(form, formValues, &document,
trigger); | 242 RefPtr<FormState> formState = FormState::create(form, formValues, &document,
trigger); |
243 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, formState.release(), formData.release(), boundary
, event)); | 243 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, formState.release(), formData.release(), boundary
, event)); |
244 } | 244 } |
245 | 245 |
246 KURL FormSubmission::requestURL() const | 246 KURL FormSubmission::requestURL() const |
247 { | 247 { |
248 if (m_method == FormSubmission::PostMethod) | 248 if (m_method == FormSubmission::PostMethod) |
249 return m_action; | 249 return m_action; |
250 | 250 |
251 KURL requestURL(m_action); | 251 KURL requestURL(m_action); |
(...skipping 18 matching lines...) Expand all Loading... |
270 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 270 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
271 else | 271 else |
272 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 272 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
273 } | 273 } |
274 | 274 |
275 frameRequest.resourceRequest().setURL(requestURL()); | 275 frameRequest.resourceRequest().setURL(requestURL()); |
276 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin)
; | 276 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin)
; |
277 } | 277 } |
278 | 278 |
279 } | 279 } |
OLD | NEW |