diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 16 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 6 |
2 files changed, 19 insertions, 3 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 61d2587..5996315 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -10,6 +10,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "Cursor.h" #include "Document.h" +#include "DocumentLoader.h" #include "Element.h" #include "Event.h" #include "EventNames.h" @@ -111,7 +112,10 @@ class MultiPartResponseClient : public WebCore::ResourceHandleClient { WebPluginResourceClient* resource_client_; }; -WebPluginContainer::WebPluginContainer(WebPluginImpl* impl) : impl_(impl) { } +WebPluginContainer::WebPluginContainer(WebPluginImpl* impl) + : impl_(impl), + ignore_response_error_(false) { +} WebPluginContainer::~WebPluginContainer() { impl_->SetContainer(NULL); @@ -221,6 +225,8 @@ void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds, void WebPluginContainer::didReceiveResponse( const WebCore::ResourceResponse& response) { + set_ignore_response_error(false); + HttpResponseInfo http_response_info; ReadHttpResponseInfo(response, &http_response_info); @@ -241,7 +247,8 @@ void WebPluginContainer::didFinishLoading() { } void WebPluginContainer::didFail(const WebCore::ResourceError&) { - impl_->delegate_->DidManualLoadFail(); + if (!ignore_response_error_) + impl_->delegate_->DidManualLoadFail(); } void WebPluginContainer::ReadHttpResponseInfo( @@ -1266,7 +1273,10 @@ bool WebPluginImpl::InitiateHTTPRequest(int resource_id, } void WebPluginImpl::CancelDocumentLoad() { - frame()->loader()->stopLoading(false); + if (frame()->loader()->activeDocumentLoader()) { + widget_->set_ignore_response_error(true); + frame()->loader()->activeDocumentLoader()->stopLoading(); + } } void WebPluginImpl::InitiateHTTPRangeRequest(const char* url, diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index 3cc60ed..4ff1757 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -87,6 +87,10 @@ class WebPluginContainer : public WebCore::Widget { void didFinishLoading(); void didFail(const WebCore::ResourceError&); + void set_ignore_response_error(bool ignore_response_error) { + ignore_response_error_ = ignore_response_error; + } + struct HttpResponseInfo { std::string url; std::wstring mime_type; @@ -100,6 +104,8 @@ class WebPluginContainer : public WebCore::Widget { private: WebPluginImpl* impl_; + // Set to true if the next response error should be ignored. + bool ignore_response_error_; }; // This is the WebKit side of the plugin implementation that forwards calls, |