Skip to content
Permalink
Browse files
Fix an assertion when a plugin returns -1 from NPP_Write
We were forgetting to call setDefersLoading(false) before destroying
the PluginStream. In the process of destroying the stream, someone
would call setDefersLoading(true), and we would assert because we were
already deferring loads.

Fixes <http://webkit.org/b/42563> Assertion failure in
ResourceHandle::setDefersLoading when running
plugins/return-negative-one-from-write.html on Windows

Reviewed by Anders Carlsson.

* plugins/PluginStream.cpp:
(WebCore::PluginStream::deliverData): Call setDefersLoading(false)
before destroying the stream, to match the setDefersLoading(true) call
earlier in this function. (We already call setDefersLoading(false) in
the non-error case later on.)

Canonical link: https://commits.webkit.org/54507@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aroben committed Jul 19, 2010
1 parent e5aebfa commit 2978c48c52c609f7017fac54a647861d5de11d7e
Showing with 23 additions and 0 deletions.
  1. +21 −0 WebCore/ChangeLog
  2. +2 −0 WebCore/plugins/PluginStream.cpp
@@ -1,3 +1,24 @@
2010-07-19 Adam Roben <aroben@apple.com>

Fix an assertion when a plugin returns -1 from NPP_Write

We were forgetting to call setDefersLoading(false) before destroying
the PluginStream. In the process of destroying the stream, someone
would call setDefersLoading(true), and we would assert because we were
already deferring loads.

Fixes <http://webkit.org/b/42563> Assertion failure in
ResourceHandle::setDefersLoading when running
plugins/return-negative-one-from-write.html on Windows

Reviewed by Anders Carlsson.

* plugins/PluginStream.cpp:
(WebCore::PluginStream::deliverData): Call setDefersLoading(false)
before destroying the stream, to match the setDefersLoading(true) call
earlier in this function. (We already call setDefersLoading(false) in
the non-error case later on.)

2010-07-19 Rafael Antognolli <antognolli@profusion.mobi>

Reviewed by Antonio Gomes.
@@ -356,6 +356,8 @@ void PluginStream::deliverData()
deliveryBytes = m_pluginFuncs->write(m_instance, &m_stream, m_offset, dataLength, (void*)data);
if (deliveryBytes < 0) {
LOG_PLUGIN_NET_ERROR();
if (m_loader)
m_loader->setDefersLoading(false);
cancelAndDestroyStream(NPRES_NETWORK_ERR);
return;
}

0 comments on commit 2978c48

Please sign in to comment.