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

Unified Diff: third_party/WebKit/Source/modules/cachestorage/Cache.cpp

Issue 1418813004: [Fetch API] Reflect spec changes of bodyUsed property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/modules/cachestorage/Cache.cpp
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
index cb21eba331c121fba59b8aee29da94e1f3d1d036..c64ad7d842440a462a7d9e9136850e0c51863ba8 100644
--- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -495,20 +495,13 @@ ScriptPromise Cache::putImpl(ScriptState* scriptState, const HeapVector<Member<R
barrierCallback->onError("Request method '" + requests[i]->method() + "' is unsupported");
return promise;
}
- if (requests[i]->hasBody() && requests[i]->bodyUsed()) {
- barrierCallback->onError("Request body is already used");
- return promise;
- }
- if (responses[i]->hasBody() && responses[i]->bodyUsed()) {
+ ASSERT(!requests[i]->hasBody());
+
+ if (responses[i]->isBodyLocked() || responses[i]->bodyUsed()) {
barrierCallback->onError("Response body is already used");
return promise;
}
- if (requests[i]->hasBody())
- requests[i]->setBodyPassed();
- if (responses[i]->hasBody())
- responses[i]->setBodyPassed();
-
BodyStreamBuffer* buffer = responses[i]->internalBodyBuffer();
if (buffer) {
// If the response has body, read the all data and create
« no previous file with comments | « third_party/WebKit/Source/core/streams/ReadableStreamTest.cpp ('k') | third_party/WebKit/Source/modules/fetch/Body.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698