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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2879853002: PlzNavigate: Fix form submission to OOPIF frame. (Closed)
Patch Set: Nits. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 55eb1ee156e9d58516b5d4eafbb640d93c2d3119..0d4a03112c29471aba26eb8a9de555265c225daf 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -199,12 +199,23 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
PreviewsState previews_state,
bool is_same_document_history_load,
bool is_history_navigation_in_new_child,
+ const scoped_refptr<ResourceRequestBodyImpl>& post_body,
const base::TimeTicks& navigation_start,
NavigationControllerImpl* controller) {
- // Fill POST data in the request body.
+ // A form submission happens either because the navigation is a
+ // renderer-initiated form submission that took the OpenURL path or a
+ // back/forward/reload navigation the does a form resubmission.
scoped_refptr<ResourceRequestBodyImpl> request_body;
- if (frame_entry.method() == "POST")
+ if (post_body) {
+ // Standard form submission from the renderer.
+ request_body = post_body;
+ } else if (frame_entry.method() == "POST") {
+ // Form resubmission during a back/forward/reload navigation.
request_body = frame_entry.GetPostData();
+ }
+ // TODO(arthursonzogni): Form submission with the "GET" method is possible.
+ // This is not currently handled here.
+ bool is_form_submission = !!request_body;
base::Optional<url::Origin> initiator =
frame_tree_node->IsMainFrame()
@@ -227,11 +238,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
false, // skip_service_worker
REQUEST_CONTEXT_TYPE_LOCATION,
blink::WebMixedContentContextType::kBlockable,
- // TODO(arthursonzogni): It can be true for form
- // resubmission when the user reloads the page. This
- // needs to be fixed.
- false, // is_form_submission
- initiator),
+ is_form_submission, initiator),
entry.ConstructRequestNavigationParams(
frame_entry, common_params.url, common_params.method,
is_history_navigation_in_new_child,
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698