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

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

Issue 1999573003: OOPIFs: Fixing submitting forms targeting a remote frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@form-target-is-cross-site-frame
Patch Set: Added a TODO for investigating if remote and local frames can be handled uniformly. Created 4 years, 6 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 KURL FormSubmission::requestURL() const 264 KURL FormSubmission::requestURL() const
265 { 265 {
266 if (m_method == FormSubmission::PostMethod) 266 if (m_method == FormSubmission::PostMethod)
267 return m_action; 267 return m_action;
268 268
269 KURL requestURL(m_action); 269 KURL requestURL(m_action);
270 requestURL.setQuery(m_formData->flattenToString()); 270 requestURL.setQuery(m_formData->flattenToString());
271 return requestURL; 271 return requestURL;
272 } 272 }
273 273
274 void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest) 274 FrameLoadRequest FormSubmission::createFrameLoadRequest(Document* originDocument )
275 { 275 {
276 FrameLoadRequest frameRequest(originDocument);
277
276 if (!m_target.isEmpty()) 278 if (!m_target.isEmpty())
277 frameRequest.setFrameName(m_target); 279 frameRequest.setFrameName(m_target);
278 280
279 if (m_method == FormSubmission::PostMethod) { 281 if (m_method == FormSubmission::PostMethod) {
280 frameRequest.resourceRequest().setHTTPMethod("POST"); 282 frameRequest.resourceRequest().setHTTPMethod("POST");
281 frameRequest.resourceRequest().setHTTPBody(m_formData); 283 frameRequest.resourceRequest().setHTTPBody(m_formData);
282 284
283 // construct some user headers if necessary 285 // construct some user headers if necessary
284 if (m_boundary.isEmpty()) 286 if (m_boundary.isEmpty())
285 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 287 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
286 else 288 else
287 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 289 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
288 } 290 }
289 291
290 frameRequest.resourceRequest().setURL(requestURL()); 292 frameRequest.resourceRequest().setURL(requestURL());
293
294 frameRequest.setTriggeringEvent(m_event);
295 frameRequest.setForm(m_form);
296
297 return frameRequest;
291 } 298 }
292 299
293 } // namespace blink 300 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FormSubmission.h ('k') | third_party/WebKit/Source/core/loader/FrameLoadRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698