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/platform | |
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/platform')
-rw-r--r-- | WebCore/platform/network/ResourceHandle.h | 6 | ||||
-rw-r--r-- | WebCore/platform/network/android/ResourceHandleAndroid.cpp | 9 | ||||
-rw-r--r-- | WebCore/platform/network/android/ResourceLoaderAndroid.h | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h index b764add..e340aca 100644 --- a/WebCore/platform/network/ResourceHandle.h +++ b/WebCore/platform/network/ResourceHandle.h @@ -189,7 +189,11 @@ public: void setClient(ResourceHandleClient*); void setDefersLoading(bool); - +#if PLATFORM(ANDROID) +// TODO: this needs upstreaming. + void pauseLoad(bool); +#endif + const ResourceRequest& request() const; void fireFailure(Timer<ResourceHandle>*); diff --git a/WebCore/platform/network/android/ResourceHandleAndroid.cpp b/WebCore/platform/network/android/ResourceHandleAndroid.cpp index 1154b47..6759852 100644 --- a/WebCore/platform/network/android/ResourceHandleAndroid.cpp +++ b/WebCore/platform/network/android/ResourceHandleAndroid.cpp @@ -84,6 +84,15 @@ bool ResourceHandle::supportsBufferedData() return false; } +#if PLATFORM(ANDROID) +// TODO: this needs upstreaming. +void ResourceHandle::pauseLoad(bool pause) +{ + if (d->m_loader) + d->m_loader->pauseLoad(pause); +} +#endif + void ResourceHandle::setDefersLoading(bool defers) { notImplemented(); diff --git a/WebCore/platform/network/android/ResourceLoaderAndroid.h b/WebCore/platform/network/android/ResourceLoaderAndroid.h index 004675e..f627d62 100644 --- a/WebCore/platform/network/android/ResourceLoaderAndroid.h +++ b/WebCore/platform/network/android/ResourceLoaderAndroid.h @@ -42,6 +42,9 @@ public: virtual void cancel() = 0; virtual void downloadFile() = 0; + // ANDROID TODO: This needs to be upstreamed. + virtual void pauseLoad(bool) = 0; + // END ANDROID TODO // Call to java to find out if this URL is in the cache static bool willLoadFromCache(const WebCore::KURL&, int64_t identifier); |