diff options
author | ddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-04 16:19:14 +0000 |
---|---|---|
committer | ddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-04 16:19:14 +0000 |
commit | 80c71de2dbd4ee5fd78a598b06daffacf3a35a7f (patch) | |
tree | 1eecec7747a9179a56b072365fac697214e699ef /ppapi/cpp | |
parent | 8f7320ed810cf0409aadae175d42463fdaebe1ab (diff) | |
download | chromium_src-80c71de2dbd4ee5fd78a598b06daffacf3a35a7f.zip chromium_src-80c71de2dbd4ee5fd78a598b06daffacf3a35a7f.tar.gz chromium_src-80c71de2dbd4ee5fd78a598b06daffacf3a35a7f.tar.bz2 |
Defer asynchronous loading when the buffer in PPB_URLLoader_Impl exceeds an optionally-specified threshold and re-enable it when the buffer drops below a lower threshold.
BUG=80684
TEST=Set the thresholds to 4 MB and 2 MB, respectively from a plugin then download a large file (> 200 MB). Observe that the renderer/plugin process memory usage in Task Manager does not exceed ~100MB and that network traffic drops to 0 then picks up again briefly after 10 MB are used.
Review URL: http://codereview.chromium.org/6923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r-- | ppapi/cpp/url_request_info.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ppapi/cpp/url_request_info.h b/ppapi/cpp/url_request_info.h index cce4e91..f0922a5 100644 --- a/ppapi/cpp/url_request_info.h +++ b/ppapi/cpp/url_request_info.h @@ -70,6 +70,14 @@ class URLRequestInfo : public Resource { return SetProperty(PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING, content_transfer_encoding); } + bool SetPrefetchBufferUpperThreshold(int32_t size) { + return SetProperty(PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD, + size); + } + bool SetPrefetchBufferLowerThreshold(int32_t size) { + return SetProperty(PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD, + size); + } }; } // namespace pp |