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

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..b2b808e7f86f25d4b9856b2d010e83f910f79fb6 100644
--- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -495,20 +495,14 @@ 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()) {
+ // We don't read |request[i]|'s body, so we don't check its
+ // availability.
hiroshige 2015/11/19 12:50:36 The spec says we must not check the request's body
yhirano 2015/11/19 13:19:03 Done.
yhirano 2015/11/19 14:17:15 Actually, a Request having 'GET' method must not h
+
+ if (responses[i]->bodyUsed() || responses[i]->isBodyLocked()) {
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

Powered by Google App Engine
This is Rietveld 408576698