summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 03:55:15 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 03:55:15 +0000
commit336374152866bf926d83c7749ff5dc0dd26d3cda (patch)
tree9771466dd1654802fd049905982a0ec357ebba6d /webkit/plugins
parent1c583cf1c0b8b3af30ff720fd4972d7ff937505f (diff)
downloadchromium_src-336374152866bf926d83c7749ff5dc0dd26d3cda.zip
chromium_src-336374152866bf926d83c7749ff5dc0dd26d3cda.tar.gz
chromium_src-336374152866bf926d83c7749ff5dc0dd26d3cda.tar.bz2
Merge 84204 - Fix renderer crash and resulting test hang in PDFBrowserTests.
I had assumed that didReceiveData() would only be called after Open(), but WebPluginImpl::didReceiveResponse() creates a PPB_URLLoader_Impl and immediately calls didReceiveData(). This correctly handles this case. BUG=80684 TEST=PDFBrowserTest TBR=brettw@chromium.org TBR=ddorwin@chromium.org Review URL: http://codereview.chromium.org/6931027 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84210 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/ppb_url_loader_impl.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
index 5684d40..d0d4f06 100644
--- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
@@ -453,12 +453,14 @@ void PPB_URLLoader_Impl::didReceiveData(WebURLLoader* loader,
// To avoid letting the network stack download an entire stream all at once,
// defer loading when we have enough buffer.
// Check the buffer size after potentially moving some to the user buffer.
- DCHECK(request_info_->prefetch_buffer_lower_threshold() <
- request_info_->prefetch_buffer_upper_threshold());
+ DCHECK(!request_info_ ||
+ (request_info_->prefetch_buffer_lower_threshold() <
+ request_info_->prefetch_buffer_upper_threshold()));
if (!is_streaming_to_file_ &&
!is_asynchronous_load_suspended_ &&
- buffer_.size() >= static_cast<size_t>(
- request_info_->prefetch_buffer_upper_threshold())) {
+ request_info_ &&
+ (buffer_.size() >= static_cast<size_t>(
+ request_info_->prefetch_buffer_upper_threshold()))) {
DVLOG(1) << "Suspending async load - buffer size: " << buffer_.size();
loader->setDefersLoading(true);
is_asynchronous_load_suspended_ = true;
@@ -522,6 +524,7 @@ size_t PPB_URLLoader_Impl::FillUserBuffer() {
buffer_.erase(buffer_.begin(), buffer_.begin() + bytes_to_copy);
// If the buffer is getting too empty, resume asynchronous loading.
+ DCHECK(!is_asynchronous_load_suspended_ || request_info_);
if (is_asynchronous_load_suspended_ &&
buffer_.size() <= static_cast<size_t>(
request_info_->prefetch_buffer_lower_threshold())) {