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

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: 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/FormSubmission.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FormSubmission.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698