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

Unified Diff: content/renderer/render_view_impl.cc

Issue 8142032: Add error description to the DidFailProvisionalLoad callback. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 2 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 | « content/renderer/render_view_browsertest.cc ('k') | content/shell/shell_content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 03a66155f38cb0d1376f413869ec603f4d60ab30..e6bf678a5ff0f3960db5a5a77725b918ea215500 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1252,10 +1252,18 @@ void RenderViewImpl::LoadNavigationErrorPage(
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()) {
+ 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);
@@ -2352,9 +2360,20 @@ void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame,
bool show_repost_interstitial =
(error.reason == net::ERR_CACHE_MISS &&
EqualsASCII(failed_request.httpMethod(), "POST"));
+
+ ViewHostMsg_DidFailProvisionalLoadWithError_Params params;
+ params.frame_id = frame->identifier();
+ params.is_main_frame = !frame->parent();
+ params.error_code = error.reason;
+ content::GetContentClient()->renderer()->GetNavigationErrorStrings(
+ failed_request,
+ error,
+ NULL,
+ &params.error_description);
+ params.url = error.unreachableURL;
+ 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_, 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.
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | content/shell/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698