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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 { | 136 { |
137 m_method = other.m_method; | 137 m_method = other.m_method; |
138 m_isMultiPartForm = other.m_isMultiPartForm; | 138 m_isMultiPartForm = other.m_isMultiPartForm; |
139 | 139 |
140 m_action = other.m_action; | 140 m_action = other.m_action; |
141 m_target = other.m_target; | 141 m_target = other.m_target; |
142 m_encodingType = other.m_encodingType; | 142 m_encodingType = other.m_encodingType; |
143 m_acceptCharset = other.m_acceptCharset; | 143 m_acceptCharset = other.m_acceptCharset; |
144 } | 144 } |
145 | 145 |
146 inline FormSubmission::FormSubmission(Method method, const KURL& action, const A
tomicString& target, const AtomicString& contentType, PassRefPtr<FormState> stat
e, PassRefPtr<FormData> data, const String& boundary, PassRefPtrWillBeRawPtr<Eve
nt> event) | 146 inline FormSubmission::FormSubmission(Method method, const KURL& action, const A
tomicString& target, const AtomicString& contentType, PassRefPtrWillBeRawPtr<For
mState> state, PassRefPtr<FormData> data, const String& boundary, PassRefPtrWill
BeRawPtr<Event> event) |
147 : m_method(method) | 147 : m_method(method) |
148 , m_action(action) | 148 , m_action(action) |
149 , m_target(target) | 149 , m_target(target) |
150 , m_contentType(contentType) | 150 , m_contentType(contentType) |
151 , m_formState(state) | 151 , m_formState(state) |
152 , m_formData(data) | 152 , m_formData(data) |
153 , m_boundary(boundary) | 153 , m_boundary(boundary) |
154 , m_event(event) | 154 , m_event(event) |
155 { | 155 { |
156 } | 156 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (copiedAttributes.method() == PostMethod && isMailtoForm) { | 236 if (copiedAttributes.method() == PostMethod && isMailtoForm) { |
237 // Convert the form data into a string that we put into the URL. | 237 // Convert the form data into a string that we put into the URL. |
238 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); | 238 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); |
239 formData = FormData::create(); | 239 formData = FormData::create(); |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 formData->setIdentifier(generateFormDataIdentifier()); | 243 formData->setIdentifier(generateFormDataIdentifier()); |
244 formData->setContainsPasswordData(containsPasswordData); | 244 formData->setContainsPasswordData(containsPasswordData); |
245 AtomicString targetOrBaseTarget = copiedAttributes.target().isEmpty() ? docu
ment.baseTarget() : copiedAttributes.target(); | 245 AtomicString targetOrBaseTarget = copiedAttributes.target().isEmpty() ? docu
ment.baseTarget() : copiedAttributes.target(); |
246 RefPtr<FormState> formState = FormState::create(*form, trigger); | 246 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, FormState::create(*form, trigger), formData.relea
se(), boundary, event)); |
247 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, formState.release(), formData.release(), boundary
, event)); | |
248 } | 247 } |
249 | 248 |
250 KURL FormSubmission::requestURL() const | 249 KURL FormSubmission::requestURL() const |
251 { | 250 { |
252 if (m_method == FormSubmission::PostMethod) | 251 if (m_method == FormSubmission::PostMethod) |
253 return m_action; | 252 return m_action; |
254 | 253 |
255 KURL requestURL(m_action); | 254 KURL requestURL(m_action); |
256 requestURL.setQuery(m_formData->flattenToString()); | 255 requestURL.setQuery(m_formData->flattenToString()); |
257 return requestURL; | 256 return requestURL; |
(...skipping 16 matching lines...) Expand all Loading... |
274 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 273 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
275 else | 274 else |
276 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
277 } | 276 } |
278 | 277 |
279 frameRequest.resourceRequest().setURL(requestURL()); | 278 frameRequest.resourceRequest().setURL(requestURL()); |
280 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), AtomicStr
ing(m_origin)); | 279 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), AtomicStr
ing(m_origin)); |
281 } | 280 } |
282 | 281 |
283 } | 282 } |
OLD | NEW |