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

Unified Diff: third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp

Issue 2321473003: Fix BytesConsumer::read (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
index c14cacabf1c539cc93f560fce8540a29cce5ddd4..72587d337ff5aa9f47a04d0a7f571cc8ca779d2e 100644
--- a/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp
@@ -323,7 +323,10 @@ BytesConsumer::Result BytesConsumer::read(char* buffer, size_t size, size_t* rea
return r;
*readSize = std::min(available, size);
memcpy(buffer, src, *readSize);
- return endRead(*readSize);
+ auto result = endRead(*readSize);
+ if (result != BytesConsumer::Result::Ok)
+ *readSize = 0;
+ return result;
}
void BytesConsumer::tee(ExecutionContext* executionContext, BytesConsumer* src, BytesConsumer** dest1, BytesConsumer** dest2)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698