diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 17:24:13 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 17:24:13 +0000 |
commit | 943b2925ce99deafb646573cf146c63dac2f33e4 (patch) | |
tree | 459ed3bb525abd6f74857ba3e83922a086298d1c /chrome/renderer/webplugin_delegate_proxy.cc | |
parent | 9762f54d6f7b357b278dfffd7b47c44e63271db9 (diff) | |
download | chromium_src-943b2925ce99deafb646573cf146c63dac2f33e4.zip chromium_src-943b2925ce99deafb646573cf146c63dac2f33e4.tar.gz chromium_src-943b2925ce99deafb646573cf146c63dac2f33e4.tar.bz2 |
Handle HTTP 200 responses received in response to byte range requests issued by the plugin. This means that the server does not support byte range requests. Firefox handles this by destroying the current plugin instance and creating a new instance to handle the response. The stream which is created to pass the data off to the plugin is not seekable.Fix is to emulate Firefox behavior. Will work on unit testing the NPN_RequestRead related code in a separate CB. This fixes http://code.google.com/p/chromium/issues/detail?id=5403Bug=5403
Review URL: http://codereview.chromium.org/14122
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 3525a1f..3bad2e4f 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -37,7 +37,8 @@ class ResourceClientProxy : public WebPluginResourceClient { public: ResourceClientProxy(PluginChannelHost* channel, int instance_id) : channel_(channel), instance_id_(instance_id), resource_id_(0), - notify_needed_(false), notify_data_(NULL) { + notify_needed_(false), notify_data_(NULL), + multibyte_response_expected_(false) { } ~ResourceClientProxy() { @@ -57,6 +58,8 @@ class ResourceClientProxy : public WebPluginResourceClient { params.notify_data = notify_data_; params.stream = existing_stream; + multibyte_response_expected_ = (existing_stream != NULL); + channel_->Send(new PluginMsg_HandleURLRequestReply(instance_id_, params)); } @@ -71,6 +74,7 @@ class ResourceClientProxy : public WebPluginResourceClient { const std::string& headers, uint32 expected_length, uint32 last_modified, + bool request_is_seekable, bool* cancel) { DCHECK(channel_ != NULL); PluginMsg_DidReceiveResponseParams params; @@ -79,6 +83,7 @@ class ResourceClientProxy : public WebPluginResourceClient { params.headers = headers; params.expected_length = expected_length; params.last_modified = last_modified; + params.request_is_seekable = request_is_seekable; // Grab a reference on the underlying channel so it does not get // deleted from under us. scoped_refptr<PluginChannelHost> channel_ref(channel_); @@ -113,6 +118,10 @@ class ResourceClientProxy : public WebPluginResourceClient { MessageLoop::current()->DeleteSoon(FROM_HERE, this); } + bool IsMultiByteResponseExpected() { + return multibyte_response_expected_; + } + private: int resource_id_; int instance_id_; @@ -120,6 +129,9 @@ private: std::string url_; bool notify_needed_; void* notify_data_; + // Set to true if the response expected is a multibyte response. + // For e.g. response for a HTTP byte range request. + bool multibyte_response_expected_; }; WebPluginDelegateProxy* WebPluginDelegateProxy::Create( |