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

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: populate... -> createFrameLoadRequest + going through RemoteFrame::navigate(FrameLoadRequest&) 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 FrameLoadRequest FormSubmission::createFrameLoadRequest(Document* originDocument )
274 { 274 {
275 FrameLoadRequest frameRequest(originDocument);
276
275 if (!m_target.isEmpty()) 277 if (!m_target.isEmpty())
276 frameRequest.setFrameName(m_target); 278 frameRequest.setFrameName(m_target);
277 279
278 if (m_method == FormSubmission::PostMethod) { 280 if (m_method == FormSubmission::PostMethod) {
279 frameRequest.resourceRequest().setHTTPMethod("POST"); 281 frameRequest.resourceRequest().setHTTPMethod("POST");
280 frameRequest.resourceRequest().setHTTPBody(m_formData); 282 frameRequest.resourceRequest().setHTTPBody(m_formData);
281 283
282 // construct some user headers if necessary 284 // construct some user headers if necessary
283 if (m_boundary.isEmpty()) 285 if (m_boundary.isEmpty())
284 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 286 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
285 else 287 else
286 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 288 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
287 } 289 }
288 290
289 frameRequest.resourceRequest().setURL(requestURL()); 291 frameRequest.resourceRequest().setURL(requestURL());
292
293 frameRequest.setTriggeringEvent(m_event);
294 frameRequest.setForm(m_form);
Łukasz Anforowicz 2016/06/08 20:32:43 These 2 statements have been moved here from Sched
295
296 return frameRequest;
290 } 297 }
291 298
292 } // namespace blink 299 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698