Chromium Code Reviews| Index: content/renderer/render_view.cc |
| diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc |
| index 91d9c2d1b830ccf86ef71d2eb6598593e6043699..c3fd1d333ab606a4dcafa61736170a1bc8b12a1b 100644 |
| --- a/content/renderer/render_view.cc |
| +++ b/content/renderer/render_view.cc |
| @@ -1251,10 +1251,18 @@ void RenderView::LoadNavigationErrorPage(WebFrame* frame, |
| const WebURLError& error, |
| const std::string& html, |
| bool replace) { |
| - std::string alt_html = !html.empty() ? html : |
| - content::GetContentClient()->renderer()->GetNavigationErrorHtml( |
| - failed_request, error); |
| - frame->loadHTMLString(alt_html, |
| + std::string alt_html; |
| + const std::string* error_html; |
| + |
| + if (!html.empty()) |
|
mmenke
2011/10/07 14:19:44
nit: Use brackets here, too, since you use them w
mkosiba (inactive)
2011/10/07 15:46:11
Done.
|
| + error_html = &html; |
| + else { |
| + content::GetContentClient()->renderer()->GetNavigationErrorStrings( |
| + failed_request, error, &alt_html, NULL); |
| + error_html = &alt_html; |
| + } |
| + |
| + frame->loadHTMLString(*error_html, |
| GURL(chrome::kUnreachableWebDataURL), |
| error.unreachableURL, |
| replace); |
| @@ -2340,9 +2348,20 @@ void RenderView::didFailProvisionalLoad(WebFrame* frame, |
| bool show_repost_interstitial = |
| (error.reason == net::ERR_CACHE_MISS && |
| EqualsASCII(failed_request.httpMethod(), "POST")); |
| + |
| + ViewHostMsg_DidFailProvisionalLoadWithError_Params ipc_params; |
| + ipc_params.frame_id = frame->identifier(); |
| + ipc_params.is_main_frame = !frame->parent(); |
| + ipc_params.error_code = error.reason; |
| + content::GetContentClient()->renderer()->GetNavigationErrorStrings( |
| + failed_request, |
| + error, |
| + NULL, |
| + &ipc_params.error_description); |
| + ipc_params.url = error.unreachableURL; |
| + ipc_params.showing_repost_interstitial = show_repost_interstitial; |
| Send(new ViewHostMsg_DidFailProvisionalLoadWithError( |
| - routing_id_, frame->identifier(), !frame->parent(), error.reason, |
| - error.unreachableURL, show_repost_interstitial)); |
| + routing_id_, ipc_params)); |
| // Don't display an error page if this is simply a cancelled load. Aside |
| // from being dumb, WebCore doesn't expect it and it will cause a crash. |
| @@ -4408,4 +4427,3 @@ void RenderView::OnLockMouseACK(bool succeeded) { |
| void RenderView::OnMouseLockLost() { |
| pepper_delegate_.OnMouseLockLost(); |
| } |
| - |