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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2687593002: PlzNavigate: Invoke didFailProvisionalLoad() in the renderer when a navigation request is cancelled… (Closed)
Patch Set: Remove null client check 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index ac047affb6a82b7f7220792e85ae53c406ddb4d0..d6b364794bcb30755be6ebbe81d30c57e91d7f89 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3503,13 +3503,6 @@ void RenderFrameImpl::didFailProvisionalLoad(
TRACE_EVENT1("navigation,benchmark,rail",
"RenderFrameImpl::didFailProvisionalLoad", "id", routing_id_);
DCHECK_EQ(frame_, frame);
- WebDataSource* ds = frame->provisionalDataSource();
- DCHECK(ds);
-
- const WebURLRequest& failed_request = ds->getRequest();
-
- // Notify the browser that we failed a provisional load with an error.
- //
// Note: It is important this notification occur before DidStopLoading so the
// SSL manager can react to the provisional load failure before being
// notified the load stopped.
@@ -3519,6 +3512,13 @@ void RenderFrameImpl::didFailProvisionalLoad(
for (auto& observer : observers_)
observer.DidFailProvisionalLoad(error);
+ WebDataSource* ds = frame->provisionalDataSource();
+ if (!ds)
+ return;
+
+ const WebURLRequest& failed_request = ds->getRequest();
+
+ // Notify the browser that we failed a provisional load with an error.
SendFailedProvisionalLoad(failed_request, error, frame);
if (!ShouldDisplayErrorPageForFailedLoad(error.reason, error.unreachableURL))
@@ -5224,6 +5224,11 @@ void RenderFrameImpl::OnFailedNavigation(
std::unique_ptr<HistoryEntry> history_entry;
if (request_params.page_state.IsValid())
history_entry = PageStateToHistoryEntry(request_params.page_state);
+
+ // For renderer initiated navigations, we send out a didFailProvisionalLoad()
+ // notification.
+ if (request_params.nav_entry_id == 0)
+ didFailProvisionalLoad(frame_, error, blink::WebStandardCommit);
LoadNavigationErrorPage(failed_request, error, replace, history_entry.get());
browser_side_navigation_pending_ = false;
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698