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

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

Issue 1872313003: PlzNavigate: don't discard pending entry in DidFailProvisionalLoad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 9c7c76531f39dbe8068e2a383acebdbcd930d5df..5693e5a36575f3eb5e0f3f1192bb7ab820def609 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -900,6 +900,17 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (!IsBrowserSideNavigationEnabled() && navigation_handle_) {
navigation_handle_->set_net_error_code(
static_cast<net::Error>(params.error_code));
+ } else {
+ // The renderer should not be sending this message unless asked to commit
+ // an error page.
+ // TODO(clamy): Stop sending DidFailProvisionalLoad IPCs at all when enough
+ // observers have moved to DidFinishNavigation.
+ if (!navigation_handle_ ||
+ navigation_handle_->GetNetErrorCode() == net::OK) {
+ bad_message::ReceivedBadMessage(
+ GetProcess(), bad_message::RFH_UNEXPECTED_FAIL_PROVISIONAL_LOAD);
Charlie Reis 2016/04/11 21:10:57 The conditions surrounding this will make it hard
clamy 2016/04/12 14:08:01 Done. It was actually hard enough to read that I t
+ return;
+ }
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
}

Powered by Google App Engine
This is Rietveld 408576698