From f7d8a3a68aa3bca4b425863b50d4f9a2a350e7d9 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 4 Dec 2008 23:28:02 +0000 Subject: Don't cancel the original manual data stream request when the plugin invokes NPN_RequestRead to initiate seekable byte range requests on the stream. While the contract on the plugins part is not fully clear from the mozilla docs, this is what Firefox does. This also improves performance greatly as the manual data stream already has most of the data which the plugin requests anyway. I verified this with large PDF files around 14-15MB. We are twice as faster with this fix. This fixes http://code.google.com/p/chromium/issues/detail?id=5009, which is an issue with the PDF file not loading at times. The problem also occurs at times in Firefox when we set breakpoints and thus slow down the operation. The Reader plugin displays its UI in child windows on a separate thread in the plugin process. These are parented to the plugin window which lives on the plugin thread. The plugin thread unfortunately is treated as an IO thread by the plugin and it uses the SendMessage API to send messages to the plugin thread and back. If the plugin fails to receive data for the PDF file in a reasonable time, it just destroys the PDF window hierarchy causing this issue. Handing the data off the manual data stream along with the byte range data speeds up the whole operation and thus avoids this issue to a great extent. Bug=5009 R=jam Review URL: http://codereview.chromium.org/12960 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6396 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/plugin/webplugin_proxy.cc | 4 ---- chrome/plugin/webplugin_proxy.h | 2 -- 2 files changed, 6 deletions(-) (limited to 'chrome/plugin') diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 7ab78629..5a94445 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -373,10 +373,6 @@ void WebPluginProxy::UpdateTransform() { SetWorldTransform(windowless_hdc_, &xf); } -void WebPluginProxy::CancelDocumentLoad() { - Send(new PluginHostMsg_CancelDocumentLoad(route_id_)); -} - void WebPluginProxy::InitiateHTTPRangeRequest(const char* url, const char* range_info, void* existing_stream, diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index c2cefc7..b578734 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -86,8 +86,6 @@ class WebPluginProxy : public WebPlugin { const base::SharedMemoryHandle& windowless_buffer, const base::SharedMemoryHandle& background_buffer); - void CancelDocumentLoad(); - void InitiateHTTPRangeRequest(const char* url, const char* range_info, void* existing_stream, -- cgit v1.1