diff options
author | mkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 15:31:58 +0000 |
---|---|---|
committer | mkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 15:31:58 +0000 |
commit | d7b175e8762301a1bfca9d17681111bbf5bf5c0a (patch) | |
tree | 3dbd962ef0417f8977eebfd362ee5ffbcb5c1e27 /content/renderer/render_view_impl.cc | |
parent | c2ee7f0e04e752bd40b1461e92756e7a320e40ec (diff) | |
download | chromium_src-d7b175e8762301a1bfca9d17681111bbf5bf5c0a.zip chromium_src-d7b175e8762301a1bfca9d17681111bbf5bf5c0a.tar.gz chromium_src-d7b175e8762301a1bfca9d17681111bbf5bf5c0a.tar.bz2 |
Add error description to the DidFailProvisionalLoad callback.
This will add an error description field to the TabContentsObserver::
DidFailProvisionalLoad callback.
The change should not have any impact on current behavior.
This is needed for the Chromium port on Android.
BUG=none
TEST=base_unittests,content_unittests,browser_tests
Review URL: http://codereview.chromium.org/8142032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_view_impl.cc')
-rw-r--r-- | content/renderer/render_view_impl.cc | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 03a6615..e6bf678 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, + ¶ms.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. |