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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2734633002: PlzNavigate: Fix the http/tests/loading/307-after-303-after-post.html and the http/tests/loading/re… (Closed)
Patch Set: Created 3 years, 10 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index db3193f26adcf690a6f252fba7e0a16914608a2d..0b1cc388f4d8d0148bca94066522b9ed2b06c13a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3439,6 +3439,27 @@ void RenderFrameImpl::didStartProvisionalLoad(
TRACE_EVENT2("navigation,benchmark,rail",
"RenderFrameImpl::didStartProvisionalLoad", "id", routing_id_,
"url", data_source->getRequest().url().string().utf8());
+
+ // PlzNavigate:
+ // If we have pending navigation to be sent to the browser, do it here.
+ if (pending_navigation_info_.get()) {
+ DCHECK(IsBrowserSideNavigationEnabled());
+ NavigationPolicyInfo info(data_source->getRequestWritable());
+ info.navigationType = pending_navigation_info_->navigation_type;
+ info.defaultPolicy = pending_navigation_info_->policy;
+ info.replacesCurrentHistoryItem =
+ pending_navigation_info_->replaces_current_history_item;
+ info.isHistoryNavigationInNewChildFrame =
+ pending_navigation_info_->history_navigation_in_new_child_frame;
+ info.isClientRedirect = pending_navigation_info_->client_redirect;
+ info.isCacheDisabled = pending_navigation_info_->cache_disabled;
+ info.form = pending_navigation_info_->form;
+
+ pending_navigation_info_.reset(nullptr);
+
+ BeginNavigation(info);
+ }
+
DocumentState* document_state = DocumentState::FromDataSource(data_source);
NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>(
document_state->navigation_state());
@@ -5469,7 +5490,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
info.urlRequest.checkForBrowserSideNavigation() &&
ShouldMakeNetworkRequestForURL(url)) {
if (info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) {
- BeginNavigation(info);
+ // The BeginNavigation() call happens in didStartProvisionalLoad(). We
+ // need to save information about the navigation here.
+ pending_navigation_info_.reset(new PendingNavigationInfo(info));
return blink::WebNavigationPolicyHandledByClient;
} else {
LoadURLExternally(info.urlRequest, info.defaultPolicy);

Powered by Google App Engine
This is Rietveld 408576698