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

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

Issue 2227403002: Remove blink::ReadableStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 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
Index: third_party/WebKit/Source/modules/fetch/Response.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp
index 76af6c3b7a532a5e1c1de7a753f6d9565f27a625..356e6b6be722176c8c219ed0507117c71c58511f 100644
--- a/third_party/WebKit/Source/modules/fetch/Response.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -26,7 +26,6 @@
#include "modules/fetch/FetchFormDataConsumerHandle.h"
#include "modules/fetch/ReadableStreamDataConsumerHandle.h"
#include "modules/fetch/ResponseInit.h"
-#include "platform/RuntimeEnabledFeatures.h"
#include "platform/network/EncodedFormData.h"
#include "platform/network/HTTPHeaderMap.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
@@ -149,21 +148,8 @@ Response* Response::create(ScriptState* scriptState, ScriptValue bodyValue, cons
RefPtr<EncodedFormData> formData = V8URLSearchParams::toImpl(body.As<v8::Object>())->toEncodedFormData();
bodyBuffer = new BodyStreamBuffer(scriptState, FetchFormDataConsumerHandle::create(executionContext, formData.release()));
contentType = "application/x-www-form-urlencoded;charset=UTF-8";
- } else if (RuntimeEnabledFeatures::responseConstructedWithReadableStreamEnabled() && ReadableStreamOperations::isReadableStream(scriptState, bodyValue)) {
- if (RuntimeEnabledFeatures::responseBodyWithV8ExtraStreamEnabled()) {
- bodyBuffer = new BodyStreamBuffer(scriptState, bodyValue);
- } else {
- std::unique_ptr<FetchDataConsumerHandle> bodyHandle;
- reader = ReadableStreamOperations::getReader(scriptState, bodyValue, exceptionState);
- if (exceptionState.hadException()) {
- reader = ScriptValue();
- bodyHandle = createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorDataConsumerHandle());
- exceptionState.clearException();
- } else {
- bodyHandle = ReadableStreamDataConsumerHandle::create(scriptState, reader);
- }
- bodyBuffer = new BodyStreamBuffer(scriptState, std::move(bodyHandle));
- }
+ } else if (ReadableStreamOperations::isReadableStream(scriptState, bodyValue)) {
+ bodyBuffer = new BodyStreamBuffer(scriptState, bodyValue);
} else {
String string = toUSVString(isolate, body, exceptionState);
if (exceptionState.hadException())

Powered by Google App Engine
This is Rietveld 408576698