OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef Body_h | 5 #ifndef Body_h |
6 #define Body_h | 6 #define Body_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ScriptPromise arrayBuffer(ScriptState*); | 49 ScriptPromise arrayBuffer(ScriptState*); |
50 ScriptPromise blob(ScriptState*); | 50 ScriptPromise blob(ScriptState*); |
51 ScriptPromise formData(ScriptState*); | 51 ScriptPromise formData(ScriptState*); |
52 ScriptPromise json(ScriptState*); | 52 ScriptPromise json(ScriptState*); |
53 ScriptPromise text(ScriptState*); | 53 ScriptPromise text(ScriptState*); |
54 ReadableByteStream* body(); | 54 ReadableByteStream* body(); |
55 | 55 |
56 bool bodyUsed() const; | 56 bool bodyUsed() const; |
57 void lockBody(LockBodyOption = LockBodyOptionNone); | 57 void lockBody(LockBodyOption = LockBodyOptionNone); |
58 | 58 |
59 bool streamAccessed() const; | 59 // Returns true if the body stream is (possibly partially) consumed. |
| 60 bool isBodyConsumed() const; |
60 void refreshBody(); | 61 void refreshBody(); |
61 | 62 |
62 // Creates a new BodyStreamBuffer to drain the data from the ReadableStream. | 63 // Creates a new BodyStreamBuffer to drain the data from the ReadableStream. |
63 BodyStreamBuffer* createDrainingStream(); | 64 BodyStreamBuffer* createDrainingStream(); |
64 | 65 |
65 // ActiveDOMObject override. | 66 // ActiveDOMObject override. |
66 virtual void stop() override; | 67 virtual void stop() override; |
67 virtual bool hasPendingActivity() const override; | 68 virtual bool hasPendingActivity() const override; |
68 | 69 |
69 DECLARE_VIRTUAL_TRACE(); | 70 DECLARE_VIRTUAL_TRACE(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool m_bodyUsed; | 103 bool m_bodyUsed; |
103 ResponseType m_responseType; | 104 ResponseType m_responseType; |
104 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; | 105 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; |
105 Member<ReadableStreamSource> m_streamSource; | 106 Member<ReadableStreamSource> m_streamSource; |
106 Member<ReadableByteStream> m_stream; | 107 Member<ReadableByteStream> m_stream; |
107 }; | 108 }; |
108 | 109 |
109 } // namespace blink | 110 } // namespace blink |
110 | 111 |
111 #endif // Body_h | 112 #endif // Body_h |
OLD | NEW |