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

Unified Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h

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/BodyStreamBuffer.h
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
index 6431e0a0ed49fa4176158fdac105089fce2f1c1d..7f973262f0a356f73511840487723a5190c23cb4 100644
--- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
+++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.h
@@ -33,6 +33,8 @@ public:
EAGERLY_FINALIZE();
// |handle| cannot be null and cannot be locked.
BodyStreamBuffer(ScriptState*, PassOwnPtr<FetchDataConsumerHandle> /* handle */);
+ // |ReadableStreamOperations::isReadableStream(stream)| must hold.
+ BodyStreamBuffer(ScriptState*, ScriptValue stream);
ScriptValue stream();
@@ -40,13 +42,7 @@ public:
PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::BlobSizePolicy);
PassRefPtr<EncodedFormData> drainAsFormData();
void startLoading(FetchDataLoader*, FetchDataLoader::Client* /* client */);
-
- // Callable only when not locked. Returns a non-null handle.
- // There is no means to "return" the handle to the body buffer: Calling
- // this function locks, disturbs and closes the stream and no one will
- // not be able to get any information from the stream and this buffer after
- // that.
- PassOwnPtr<FetchDataConsumerHandle> releaseHandle();
+ void tee(BodyStreamBuffer**, BodyStreamBuffer**);
// UnderlyingSource
void pullSource() override;
@@ -84,6 +80,7 @@ private:
void processData();
void endLoading();
void stopLoading();
+ PassOwnPtr<FetchDataConsumerHandle> releaseHandle();
RefPtr<ScriptState> m_scriptState;
OwnPtr<FetchDataConsumerHandle> m_handle;
@@ -92,6 +89,7 @@ private:
// We need this member to keep it alive while loading.
Member<FetchDataLoader> m_loader;
bool m_streamNeedsMore = false;
+ bool m_madeFromReadableStream;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698