| 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 BodyStreamBuffer_h | 5 #ifndef BodyStreamBuffer_h |
| 6 #define BodyStreamBuffer_h | 6 #define BodyStreamBuffer_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class EncodedFormData; | 22 class EncodedFormData; |
| 23 class ScriptState; | 23 class ScriptState; |
| 24 | 24 |
| 25 class MODULES_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, | 25 class MODULES_EXPORT BodyStreamBuffer final : public UnderlyingSourceBase, |
| 26 public BytesConsumer::Client { | 26 public BytesConsumer::Client { |
| 27 WTF_MAKE_NONCOPYABLE(BodyStreamBuffer); | 27 WTF_MAKE_NONCOPYABLE(BodyStreamBuffer); |
| 28 USING_GARBAGE_COLLECTED_MIXIN(BodyStreamBuffer); | 28 USING_GARBAGE_COLLECTED_MIXIN(BodyStreamBuffer); |
| 29 | 29 |
| 30 public: | 30 public: |
| 31 // |handle| cannot be null and cannot be locked. | |
| 32 // This function must be called with entering an appropriate V8 context. | |
| 33 BodyStreamBuffer(ScriptState*, | |
| 34 std::unique_ptr<FetchDataConsumerHandle> /* handle */); | |
| 35 // |consumer| must not have a client. | 31 // |consumer| must not have a client. |
| 36 // This function must be called with entering an appropriate V8 context. | 32 // This function must be called with entering an appropriate V8 context. |
| 37 BodyStreamBuffer(ScriptState*, BytesConsumer* /* consumer */); | 33 BodyStreamBuffer(ScriptState*, BytesConsumer* /* consumer */); |
| 38 // |ReadableStreamOperations::isReadableStream(stream)| must hold. | 34 // |ReadableStreamOperations::isReadableStream(stream)| must hold. |
| 39 // This function must be called with entering an appropriate V8 context. | 35 // This function must be called with entering an appropriate V8 context. |
| 40 BodyStreamBuffer(ScriptState*, ScriptValue stream); | 36 BodyStreamBuffer(ScriptState*, ScriptValue stream); |
| 41 | 37 |
| 42 ScriptValue stream(); | 38 ScriptValue stream(); |
| 43 | 39 |
| 44 // Callable only when neither locked nor disturbed. | 40 // Callable only when neither locked nor disturbed. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 Member<BytesConsumer> m_consumer; | 82 Member<BytesConsumer> m_consumer; |
| 87 // We need this member to keep it alive while loading. | 83 // We need this member to keep it alive while loading. |
| 88 Member<FetchDataLoader> m_loader; | 84 Member<FetchDataLoader> m_loader; |
| 89 bool m_streamNeedsMore = false; | 85 bool m_streamNeedsMore = false; |
| 90 bool m_madeFromReadableStream; | 86 bool m_madeFromReadableStream; |
| 91 }; | 87 }; |
| 92 | 88 |
| 93 } // namespace blink | 89 } // namespace blink |
| 94 | 90 |
| 95 #endif // BodyStreamBuffer_h | 91 #endif // BodyStreamBuffer_h |
| OLD | NEW |