diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-27 00:36:42 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-27 00:36:42 +0000 |
commit | 11a6577be7257bb1e16ac40ea355ae8827812784 (patch) | |
tree | 44cb04c9f71c0799f0a054526c7ec1e539fbea5c /webkit/glue | |
parent | 01477e78d0ea69d3ad636e7662746ea7c0a6d772 (diff) | |
download | chromium_src-11a6577be7257bb1e16ac40ea355ae8827812784.zip chromium_src-11a6577be7257bb1e16ac40ea355ae8827812784.tar.gz chromium_src-11a6577be7257bb1e16ac40ea355ae8827812784.tar.bz2 |
RenderView: When loading an alternate error page fails,
send the original WebURLRequest to the Delegate, rather
than a NULL pointer.
The new network error pages hide the in-page reload button for
POSTs, and need the WebURLRequest to identify requests that
were originally POSTs. The reason for hiding the button is
that it doesn't correctly handle resubmitting the form, due
to a longstanding issue.
BUG=174194,233236
R=creis@chromium.org, darin@chromium.org
Review URL: https://codereview.chromium.org/14273011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/alt_error_page_resource_fetcher.cc | 6 | ||||
-rw-r--r-- | webkit/glue/alt_error_page_resource_fetcher.h | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/webkit/glue/alt_error_page_resource_fetcher.cc b/webkit/glue/alt_error_page_resource_fetcher.cc index d98e069..1fe8242 100644 --- a/webkit/glue/alt_error_page_resource_fetcher.cc +++ b/webkit/glue/alt_error_page_resource_fetcher.cc @@ -22,10 +22,12 @@ static const int kDownloadTimeoutSec = 3; AltErrorPageResourceFetcher::AltErrorPageResourceFetcher( const GURL& url, WebFrame* frame, + const WebURLRequest& original_request, const WebURLError& original_error, const Callback& callback) : frame_(frame), callback_(callback), + original_request_(original_request), original_error_(original_error) { fetcher_.reset(new ResourceFetcherWithTimeout( url, frame, WebURLRequest::TargetIsMainFrame, kDownloadTimeoutSec, @@ -45,9 +47,9 @@ void AltErrorPageResourceFetcher::OnURLFetchComplete( const std::string& data) { // A null response indicates a network error. if (!response.isNull() && response.httpStatusCode() == 200) { - callback_.Run(frame_, original_error_, data); + callback_.Run(frame_, original_request_, original_error_, data); } else { - callback_.Run(frame_, original_error_, std::string()); + callback_.Run(frame_, original_request_, original_error_, std::string()); } } diff --git a/webkit/glue/alt_error_page_resource_fetcher.h b/webkit/glue/alt_error_page_resource_fetcher.h index 6cce034..00a4b93 100644 --- a/webkit/glue/alt_error_page_resource_fetcher.h +++ b/webkit/glue/alt_error_page_resource_fetcher.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebURLError.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" #include "webkit/glue/webkit_glue_export.h" namespace WebKit { @@ -26,12 +27,15 @@ class AltErrorPageResourceFetcher { // This will be called when the alternative error page has been fetched, // successfully or not. If there is a failure, the third parameter (the // data) will be empty. - typedef base::Callback<void(WebKit::WebFrame*, const WebKit::WebURLError&, - const std::string&)> Callback; + typedef base::Callback<void(WebKit::WebFrame*, + const WebKit::WebURLRequest&, + const WebKit::WebURLError&, + const std::string&)> Callback; WEBKIT_GLUE_EXPORT AltErrorPageResourceFetcher( const GURL& url, WebKit::WebFrame* frame, + const WebKit::WebURLRequest& original_request, const WebKit::WebURLError& original_error, const Callback& callback); WEBKIT_GLUE_EXPORT ~AltErrorPageResourceFetcher(); @@ -49,6 +53,10 @@ class AltErrorPageResourceFetcher { WebKit::WebFrame* frame_; Callback callback_; + // The original request. If loading the alternate error page fails, it's + // needed to generate the error page. + WebKit::WebURLRequest original_request_; + // The error associated with this load. If there's an error talking with the // alt error page server, we need this to complete the original load. WebKit::WebURLError original_error_; |