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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 KURL FormSubmission::requestURL() const | 263 KURL FormSubmission::requestURL() const |
264 { | 264 { |
265 if (m_method == FormSubmission::PostMethod) | 265 if (m_method == FormSubmission::PostMethod) |
266 return m_action; | 266 return m_action; |
267 | 267 |
268 KURL requestURL(m_action); | 268 KURL requestURL(m_action); |
269 requestURL.setQuery(m_formData->flattenToString()); | 269 requestURL.setQuery(m_formData->flattenToString()); |
270 return requestURL; | 270 return requestURL; |
271 } | 271 } |
272 | 272 |
273 void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest) | 273 void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest) |
Nate Chapin
2016/06/07 21:35:51
I'm not sure this is worth keeping anymore. Maybe
Łukasz Anforowicz
2016/06/08 20:32:43
Actually, I decided to go through RemoteFrame::nav
| |
274 { | 274 { |
275 if (!m_target.isEmpty()) | 275 if (!m_target.isEmpty()) |
276 frameRequest.setFrameName(m_target); | 276 frameRequest.setFrameName(m_target); |
277 | 277 |
278 populateResourceRequest(frameRequest.resourceRequest()); | |
279 } | |
280 | |
281 void FormSubmission::populateResourceRequest(ResourceRequest& resourceRequest) | |
Nate Chapin
2016/06/07 21:35:51
Maybe have this return a ResourceRequest instead o
Łukasz Anforowicz
2016/06/08 20:32:43
Good idea. Let me change
void FormSubmission:
| |
282 { | |
278 if (m_method == FormSubmission::PostMethod) { | 283 if (m_method == FormSubmission::PostMethod) { |
279 frameRequest.resourceRequest().setHTTPMethod("POST"); | 284 resourceRequest.setHTTPMethod("POST"); |
280 frameRequest.resourceRequest().setHTTPBody(m_formData); | 285 resourceRequest.setHTTPBody(m_formData); |
281 | 286 |
282 // construct some user headers if necessary | 287 // construct some user headers if necessary |
283 if (m_boundary.isEmpty()) | 288 if (m_boundary.isEmpty()) |
284 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 289 resourceRequest.setHTTPContentType(m_contentType); |
285 else | 290 else |
286 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); | 291 resourceRequest.setHTTPContentType(m_contentType + "; boundary=" + m _boundary); |
287 } | 292 } |
288 | 293 |
289 frameRequest.resourceRequest().setURL(requestURL()); | 294 resourceRequest.setURL(requestURL()); |
290 } | 295 } |
291 | 296 |
292 } // namespace blink | 297 } // namespace blink |
OLD | NEW |