summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-06 07:29:15 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-06 07:29:15 +0000
commit3faad6edb0ae2f2cb796b0e4c2a015f2a9c4e33c (patch)
tree327e4caa81980be050ab0c291e243a5d018ac671
parent02e2a3c9e18aeb57a2e22d824afc30c1bf9259b9 (diff)
downloadchromium_src-3faad6edb0ae2f2cb796b0e4c2a015f2a9c4e33c.zip
chromium_src-3faad6edb0ae2f2cb796b0e4c2a015f2a9c4e33c.tar.gz
chromium_src-3faad6edb0ae2f2cb796b0e4c2a015f2a9c4e33c.tar.bz2
Improve PDF FastWebView performance. This occurs because the manual data stream load does not get cancelled correctly. This causes the IPC messages for the manual data stream to continue going back and forth. They are ignored
by the plugin anyways. This fixes http://code.google.com/p/chromium/issues/detail?id=5196. Fix is to cancel the manual document load correctly. Bug=5196 Review URL: http://codereview.chromium.org/13198 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6486 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webplugin_impl.cc16
-rw-r--r--webkit/glue/webplugin_impl.h6
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,