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

Unified Diff: Source/modules/fetch/Body.h

Issue 1053503002: [Fetch] Response.clone should tee the body stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | Source/modules/fetch/Body.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/Body.h
diff --git a/Source/modules/fetch/Body.h b/Source/modules/fetch/Body.h
index 58f7d1d4c446ab49093a8add24d429af80ada585..3751b7fe5034bdc8472e59b6d508763ce3de708a 100644
--- a/Source/modules/fetch/Body.h
+++ b/Source/modules/fetch/Body.h
@@ -20,7 +20,6 @@ namespace blink {
class BodyStreamBuffer;
class ReadableByteStream;
-class ReadableByteStreamReader;
class ScriptState;
class Body
@@ -39,6 +38,11 @@ public:
ResponseAsJSON,
ResponseAsText
};
+ enum LockBodyOption {
+ LockBodyOptionNone,
+ // Setting "body passed" flag in addition to acquiring a lock.
+ PassBody,
+ };
explicit Body(ExecutionContext*);
virtual ~Body() { }
@@ -49,12 +53,11 @@ public:
ScriptPromise text(ScriptState*);
ReadableByteStream* body();
- // Sets the bodyUsed flag to true. This signifies that the contents of the
- // body have been consumed and cannot be accessed again.
- void setBodyUsed();
bool bodyUsed() const;
+ void lockBody(LockBodyOption = LockBodyOptionNone);
bool streamAccessed() const;
+ void refreshBody();
// Creates a new BodyStreamBuffer to drain the data from the ReadableStream.
BodyStreamBuffer* createDrainingStream();
@@ -101,7 +104,6 @@ private:
RefPtrWillBeMember<ScriptPromiseResolver> m_resolver;
Member<ReadableStreamSource> m_streamSource;
Member<ReadableByteStream> m_stream;
- Member<ReadableByteStreamReader> m_streamReader;
};
} // namespace blink
« no previous file with comments | « LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | Source/modules/fetch/Body.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698