diff options
author | Ben Murdoch <benm@google.com> | 2010-03-12 20:46:03 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-03-22 20:50:51 +0000 |
commit | a923424180b9d2cbe3a3951caed13039eef1edf6 (patch) | |
tree | 94c79707c7425deaee1f53e35512bd3760e6c8e9 /WebCore/plugins/PluginStream.cpp | |
parent | 343ec940062f940a47d74fc359b661de8be2f3b8 (diff) | |
download | external_webkit-a923424180b9d2cbe3a3951caed13039eef1edf6.zip external_webkit-a923424180b9d2cbe3a3951caed13039eef1edf6.tar.gz external_webkit-a923424180b9d2cbe3a3951caed13039eef1edf6.tar.bz2 |
Add a new API on the resource loader to pause the current load. We use this when the plugin cannot accept any more data to prevent WebKit
buffering the data that the plugin can't take. This can result in a crash if the buffer gets too big (when watching an HD movie clip in
flash, for example).
Requires a frameworks/base change.
Change-Id: Ibb63d38df1014ff70fa4d65275613cbf3a217c1a
Diffstat (limited to 'WebCore/plugins/PluginStream.cpp')
-rw-r--r-- | WebCore/plugins/PluginStream.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp index bf35ba4..1e91c51 100644 --- a/WebCore/plugins/PluginStream.cpp +++ b/WebCore/plugins/PluginStream.cpp @@ -345,6 +345,11 @@ void PluginStream::deliverData() int32 deliveryBytes = m_pluginFuncs->writeready(m_instance, &m_stream); if (deliveryBytes <= 0) { +#if PLATFORM(ANDROID) +// TODO: This needs to be upstreamed. + if (m_loader) + m_loader->pauseLoad(true); +#endif m_delayDeliveryTimer.startOneShot(0); break; } else { @@ -373,6 +378,11 @@ void PluginStream::deliverData() memmove(m_deliveryData->data(), m_deliveryData->data() + totalBytesDelivered, remainingBytes); m_deliveryData->resize(remainingBytes); } else { +#if PLATFORM(ANDROID) +//TODO: This needs to be upstreamed to WebKit. + if (m_loader) + m_loader->pauseLoad(false); +#endif m_deliveryData->resize(0); if (m_reason != WebReasonNone) destroyStream(); |