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

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

Issue 1908213004: [Streams] Remove SetReadableStreamDisturbed from ReadableStream.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp ('k') | 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/Request.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp
index cc1a6f89f60208feaf5d4d6e866376c2f7898881..a48626008431858a6e46d281163944e0bd304e30 100644
--- a/third_party/WebKit/Source/modules/fetch/Request.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
@@ -363,10 +363,14 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
// "If |input| is a Request object and |input|'s request's body is
// non-null, run these substeps:"
if (inputRequest && inputRequest->bodyBuffer()) {
- // "Set |input|'s body to an empty byte stream."
- inputRequest->m_request->setBuffer(new BodyStreamBuffer(scriptState, createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumerHandle())));
- // "Set |input|'s disturbed flag."
- inputRequest->bodyBuffer()->setDisturbed();
+ // "Let |dummyStream| be an empty ReadableStream object."
+ auto dummyStream = new BodyStreamBuffer(scriptState, createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumerHandle()));
+ // "Set |input|'s request's body to a new body whose stream is
+ // |dummyStream|."
+ inputRequest->m_request->setBuffer(dummyStream);
+ // "Let |reader| be the result of getting reader from |dummyStream|."
+ // "Read all bytes from |dummyStream| with |reader|."
+ inputRequest->bodyBuffer()->closeAndLockAndDisturb();
}
// "Return |r|."
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698