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 961b37d27b9c034e13fa69c3078acc900c62efbf..0a9ae90ead25d4b4d79646540df8826797e2b8a6 100644 |
--- a/content/browser/frame_host/navigator_impl.cc |
+++ b/content/browser/frame_host/navigator_impl.cc |
@@ -269,7 +269,8 @@ bool NavigatorImpl::NavigateToEntry( |
const NavigationEntryImpl& entry, |
NavigationController::ReloadType reload_type, |
bool is_same_document_history_load, |
- bool is_pending_entry) { |
+ bool is_pending_entry, |
+ const scoped_refptr<ResourceRequestBody>& post_body) { |
TRACE_EVENT0("browser,navigation", "NavigatorImpl::NavigateToEntry"); |
GURL dest_url = frame_entry.url(); |
@@ -387,9 +388,9 @@ bool NavigatorImpl::NavigateToEntry( |
FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType( |
controller_->GetBrowserContext(), entry, reload_type); |
dest_render_frame_host->Navigate( |
- entry.ConstructCommonNavigationParams(frame_entry, nullptr, dest_url, |
- dest_referrer, navigation_type, |
- lofi_state, navigation_start), |
+ entry.ConstructCommonNavigationParams( |
+ frame_entry, post_body, dest_url, dest_referrer, navigation_type, |
+ lofi_state, navigation_start), |
entry.ConstructStartNavigationParams(), |
entry.ConstructRequestNavigationParams( |
frame_entry, is_same_document_history_load, |
@@ -436,7 +437,7 @@ bool NavigatorImpl::NavigateToPendingEntry( |
bool is_same_document_history_load) { |
return NavigateToEntry(frame_tree_node, frame_entry, |
*controller_->GetPendingEntry(), reload_type, |
- is_same_document_history_load, true); |
+ is_same_document_history_load, true, nullptr); |
Charlie Reis
2016/05/31 21:08:36
Sanity check: Will we need to change this when we
Łukasz Anforowicz
2016/05/31 22:40:55
I don't really know :-( AFAIK, we don't need to s
clamy
2016/06/01 13:22:37
In the current architecture, the POST body should
Charlie Reis
2016/06/01 23:46:32
Yeah, this answers my question. The PageState sho
|
} |
bool NavigatorImpl::NavigateNewChildFrame( |
@@ -457,7 +458,7 @@ bool NavigatorImpl::NavigateNewChildFrame( |
return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, |
*entry, NavigationControllerImpl::NO_RELOAD, false, |
- false); |
+ false, nullptr); |
} |
void NavigatorImpl::DidNavigate( |
@@ -724,7 +725,12 @@ void NavigatorImpl::RequestTransferURL( |
const Referrer& referrer, |
ui::PageTransition page_transition, |
const GlobalRequestID& transferred_global_request_id, |
- bool should_replace_current_entry) { |
+ bool should_replace_current_entry, |
+ const std::string& method, |
+ const scoped_refptr<ResourceRequestBody>& post_body) { |
+ // |method != "POST"| should imply absence of |post_body|. |
+ DCHECK(method == "POST" || !post_body); |
Charlie Reis
2016/05/31 21:08:36
Should we be concerned if this fails in practice?
Łukasz Anforowicz
2016/05/31 22:40:55
Yes, we should be concerned, but I don't know how
Charlie Reis
2016/06/01 23:46:32
Doesn't sound like a crashable offense, but maybe
Łukasz Anforowicz
2016/06/02 22:07:04
Done. To reset the parameter we need to make it n
|
+ |
// This call only makes sense for subframes if OOPIFs are possible. |
DCHECK(!render_frame_host->GetParent() || |
SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
@@ -788,12 +794,10 @@ void NavigatorImpl::RequestTransferURL( |
is_renderer_initiated, std::string(), |
controller_->GetBrowserContext())); |
} |
- // 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, PageState(), method, -1); |
} else { |
// Main frame case. |
entry = NavigationEntryImpl::FromNavigationEntry( |
@@ -823,14 +827,13 @@ void NavigatorImpl::RequestTransferURL( |
// further in https://crbug.com/536906. |
scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node)); |
if (!frame_entry) { |
- // TODO(creis): Handle POST submissions here, as above. |
frame_entry = new FrameNavigationEntry( |
node->unique_name(), -1, -1, nullptr, |
static_cast<SiteInstanceImpl*>(source_site_instance), dest_url, |
- referrer_to_use, "GET", -1); |
+ referrer_to_use, method, -1); |
} |
NavigateToEntry(node, *frame_entry, *entry.get(), |
- NavigationController::NO_RELOAD, false, false); |
+ NavigationController::NO_RELOAD, false, false, post_body); |
} |
// PlzNavigate |