diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 03:17:25 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 03:17:25 +0000 |
commit | 22dac03746590ef7367c8af21ace424b77cae16d (patch) | |
tree | eeb18ac9183d40d8c03b5de53919d587e9b92c5b /webkit | |
parent | 88a489591b85c207049c5d89953a1a909b906aa8 (diff) | |
download | chromium_src-22dac03746590ef7367c8af21ace424b77cae16d.zip chromium_src-22dac03746590ef7367c8af21ace424b77cae16d.tar.gz chromium_src-22dac03746590ef7367c8af21ace424b77cae16d.tar.bz2 |
Fix regression in which NPRES_NETWORK_ERR instead of NPRES_USER_BREAK was passed to a plugin when a tab that it created was closed by the user. This ended up stopping the launching video.
BUG=23102
Review URL: http://codereview.chromium.org/373024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 8314b93..d3c8e9c 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "net/base/escape.h" +#include "net/base/net_errors.h" #include "skia/ext/platform_canvas.h" #include "webkit/api/public/WebConsoleMessage.h" #include "webkit/api/public/WebCString.h" @@ -23,6 +24,7 @@ #include "webkit/api/public/WebPluginParams.h" #include "webkit/api/public/WebRect.h" #include "webkit/api/public/WebURL.h" +#include "webkit/api/public/WebURLError.h" #include "webkit/api/public/WebURLLoader.h" #include "webkit/api/public/WebURLLoaderClient.h" #include "webkit/api/public/WebURLResponse.h" @@ -354,11 +356,13 @@ void WebPluginImpl::didFinishLoadingFrameRequest( void WebPluginImpl::didFailLoadingFrameRequest( const WebURL& url, void* notify_data, const WebURLError& error) { - // TODO(darin): Map net::ERR_ABORTED to NPRES_USER_BREAK? - if (delegate_) { - delegate_->DidFinishLoadWithReason( - url, NPRES_NETWORK_ERR, reinterpret_cast<intptr_t>(notify_data)); - } + if (!delegate_) + return; + + NPReason reason = + error.reason == net::ERR_ABORTED ? NPRES_USER_BREAK : NPRES_NETWORK_ERR; + delegate_->DidFinishLoadWithReason( + url, reason, reinterpret_cast<intptr_t>(notify_data)); } // ----------------------------------------------------------------------------- |