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

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

Issue 1018243002: [Fetch] Support various operations after reading data partially. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@async-read
Patch Set: Created 5 years, 9 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/Body.cpp ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/Response.cpp
diff --git a/Source/modules/fetch/Response.cpp b/Source/modules/fetch/Response.cpp
index 25a33948a6c980c56f0d14ae610b32391fffabf8..6e43fbcf9cd354d441b3436c981033062925f861 100644
--- a/Source/modules/fetch/Response.cpp
+++ b/Source/modules/fetch/Response.cpp
@@ -301,17 +301,8 @@ Response* Response::clone(ExceptionState& exceptionState)
exceptionState.throwTypeError("Response body is already used");
return nullptr;
}
- // FIXME: We throw an error while cloning the Response which body was
- // partially read. But in Request case, we don't. When the behavior of the
- // partially read streams will be well defined in the spec, we have to
- // implement the behavior correctly.
if (streamAccessed()) {
- bool dataLost = false;
- BodyStreamBuffer* drainingStream = createDrainingStream(&dataLost);
- if (dataLost) {
- exceptionState.throwTypeError("Cloning the Response which body was partially read is not supported.");
- return nullptr;
- }
+ BodyStreamBuffer* drainingStream = createDrainingStream();
m_response->replaceBodyStreamBuffer(drainingStream);
}
return Response::createClone(*this);
« no previous file with comments | « Source/modules/fetch/Body.cpp ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698