Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index 90e3b774554884375faa7e7cbdf99e268c6a2c61..da88318c3644982c15a2e2f2290f1c40fa2ab44b 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -3505,12 +3505,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. |
| // |
|
nasko
2017/02/08 23:52:22
nit: You don't need this extra "// " line.
ananta
2017/02/08 23:59:21
Thanks. Removed
|
| // Note: It is important this notification occur before DidStopLoading so the |
| // SSL manager can react to the provisional load failure before being |
| @@ -3521,6 +3515,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)) |
| @@ -5223,6 +5224,10 @@ 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() |
|
nasko
2017/02/08 23:52:22
nit: Empty line before the comment.
ananta
2017/02/08 23:59:21
Done.
|
| + // 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; |
| } |