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

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

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 6fcdb074b4a0f6badd1ea04256214a7e2223480d..7d9be13462808959491737ed2611104061a4fece 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -378,7 +378,8 @@ bool NavigatorImpl::NavigateToEntry(
entry.ConstructCommonNavigationParams(dest_url, dest_referrer,
navigation_type, lofi_state,
navigation_start),
- entry.ConstructStartNavigationParams(),
+ entry.ConstructStartNavigationParams(
+ *dest_render_frame_host->navigation_handle()),
clamy 2016/05/12 05:32:48 This is unsafe. In non transfer cases the dest RFH
Łukasz Anforowicz 2016/05/17 23:52:56 Done. In subsequent patchsets I've added |const N
entry.ConstructRequestNavigationParams(
frame_entry, is_same_document_history_load,
frame_tree_node->has_committed_real_load(),
@@ -771,12 +772,22 @@ void NavigatorImpl::RequestTransferURL(
is_renderer_initiated, std::string(),
controller_->GetBrowserContext()));
}
+ // TODO(lukasza): DO NOT SUBMIT: This seems very wrong:
+ // 1. This ignores methods other than GET and POST
+ // 2. This feels like a wrong place to do stuff.
+ // 3. This doesn't touch PageState at all...
+ bool is_post = static_cast<bool>(
clamy 2016/05/12 05:32:48 Suggestion: add the method as a parameter of Reque
Łukasz Anforowicz 2016/05/17 23:52:56 I've ended up passing |const NavigationHandleImpl*
+ render_frame_host->navigation_handle()->resource_request_body());
+
// TODO(creis): Handle POST submissions. See https://crbug.com/582211 and
// https://crbug.com/101395.
entry->AddOrUpdateFrameEntry(
node, -1, -1, nullptr,
static_cast<SiteInstanceImpl*>(source_site_instance), dest_url,
- referrer_to_use, PageState(), "GET", -1);
+ referrer_to_use,
+ // TODO(lukasza): DO NOT SUBMIT: Should I populate a real PageState here
+ // (using NavigationHandleImpl::resource_request_body() I've introduced)
clamy 2016/05/12 05:32:48 If you populate the PageState the RenderFrame will
Łukasz Anforowicz 2016/05/17 23:52:56 Acknowledged.
+ PageState(), is_post ? "POST" : "GET", -1);
} else {
// Main frame case.
entry = NavigationEntryImpl::FromNavigationEntry(
@@ -807,6 +818,7 @@ void NavigatorImpl::RequestTransferURL(
scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node));
if (!frame_entry) {
// TODO(creis): Handle POST submissions here, as above.
+ // TODO(lukasza): DO NOT SUBMIT: Need to do something here as well.
frame_entry = new FrameNavigationEntry(
node->unique_name(), -1, -1, nullptr,
static_cast<SiteInstanceImpl*>(source_site_instance), dest_url,

Powered by Google App Engine
This is Rietveld 408576698