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

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

Issue 1969333002: [Fetch API] |(new Response(stream)).body| should return |stream| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/FetchResponseData.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
index a3500d2943f28567a4ff02611b1da49b37d120e6..56cc54cbab3e24c1302a919e646a2f4692b02610 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
@@ -10,7 +10,6 @@
#include "core/fetch/FetchUtils.h"
#include "modules/fetch/BodyStreamBuffer.h"
#include "modules/fetch/DataConsumerHandleUtil.h"
-#include "modules/fetch/DataConsumerTee.h"
#include "modules/fetch/FetchHeaderList.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
@@ -190,10 +189,11 @@ FetchResponseData* FetchResponseData::clone(ScriptState* scriptState)
case DefaultType: {
ASSERT(!m_internalResponse);
if (m_buffer) {
- OwnPtr<WebDataConsumerHandle> handle1, handle2;
- DataConsumerTee::create(scriptState->getExecutionContext(), m_buffer->releaseHandle(), &handle1, &handle2);
- m_buffer = new BodyStreamBuffer(scriptState, createFetchDataConsumerHandleFromWebHandle(std::move(handle1)));
- newResponse->m_buffer = new BodyStreamBuffer(scriptState, createFetchDataConsumerHandleFromWebHandle(std::move(handle2)));
+ BodyStreamBuffer* new1 = nullptr;
+ BodyStreamBuffer* new2 = nullptr;
+ m_buffer->tee(&new1, &new2);
+ m_buffer = new1;
+ newResponse->m_buffer = new2;
}
break;
}
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp ('k') | third_party/WebKit/Source/modules/fetch/Response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698