Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: Source/modules/fetch/FetchBlobDataConsumerHandle.cpp

Issue 1192913007: Change BodyStreamBuffer to be FetchDataConsumerHandle-based and enable backpressure in Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/fetch/BodyStreamBufferTest.cpp ('k') | Source/modules/fetch/FetchManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
diff --git a/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp b/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
index e63492e2d0c5a408f9f5185f4d6aac6cf9d7f952..870ea7703134b7115d5c34e253d757cdd1e41600 100644
--- a/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
+++ b/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
@@ -363,7 +363,7 @@ public:
return Done;
m_readerContext->ensureStartLoader();
Result r = m_reader->read(data, size, flags, readSize);
- if (r != ShouldWait) {
+ if (r != ShouldWait && !(r == Ok && *readSize == 0)) {
// We read non-empty data, so we cannot use the blob data
// handle which represents the whole data.
m_readerContext->clearBlobDataHandleForDrain();
@@ -377,7 +377,7 @@ public:
return Done;
m_readerContext->ensureStartLoader();
Result r = m_reader->beginRead(buffer, flags, available);
- if (r != ShouldWait) {
+ if (r != ShouldWait && !(r == Ok && *available == 0)) {
// We read non-empty data, so we cannot use the blob data
// handle which represents the whole data.
m_readerContext->clearBlobDataHandleForDrain();
« no previous file with comments | « Source/modules/fetch/BodyStreamBufferTest.cpp ('k') | Source/modules/fetch/FetchManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698