| 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/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 USING_GARBAGE_COLLECTED_MIXIN(Body); | 38 USING_GARBAGE_COLLECTED_MIXIN(Body); |
| 39 public: | 39 public: |
| 40 explicit Body(ExecutionContext*); | 40 explicit Body(ExecutionContext*); |
| 41 ~Body() override { } | 41 ~Body() override { } |
| 42 | 42 |
| 43 ScriptPromise arrayBuffer(ScriptState*); | 43 ScriptPromise arrayBuffer(ScriptState*); |
| 44 ScriptPromise blob(ScriptState*); | 44 ScriptPromise blob(ScriptState*); |
| 45 ScriptPromise formData(ScriptState*); | 45 ScriptPromise formData(ScriptState*); |
| 46 ScriptPromise json(ScriptState*); | 46 ScriptPromise json(ScriptState*); |
| 47 ScriptPromise text(ScriptState*); | 47 ScriptPromise text(ScriptState*); |
| 48 ScriptValue bodyWithUseCounter(ScriptState*); | 48 ReadableByteStream* bodyWithUseCounter(); |
| 49 virtual BodyStreamBuffer* bodyBuffer() = 0; | 49 virtual BodyStreamBuffer* bodyBuffer() = 0; |
| 50 virtual const BodyStreamBuffer* bodyBuffer() const = 0; | 50 virtual const BodyStreamBuffer* bodyBuffer() const = 0; |
| 51 ScriptValue v8ExtraStreamBody(ScriptState*); |
| 51 | 52 |
| 52 virtual bool bodyUsed(); | 53 virtual bool bodyUsed(); |
| 53 bool isBodyLocked(); | 54 bool isBodyLocked(); |
| 54 | 55 |
| 55 // ActiveScriptWrappable override. | 56 // ActiveScriptWrappable override. |
| 56 bool hasPendingActivity() const override; | 57 bool hasPendingActivity() const override; |
| 57 | 58 |
| 58 DEFINE_INLINE_VIRTUAL_TRACE() | 59 DEFINE_INLINE_VIRTUAL_TRACE() |
| 59 { | 60 { |
| 60 ActiveDOMObject::trace(visitor); | 61 ActiveDOMObject::trace(visitor); |
| 61 } | 62 } |
| 62 | 63 |
| 63 private: | 64 private: |
| 65 ReadableByteStream* body(); |
| 64 virtual String mimeType() const = 0; | 66 virtual String mimeType() const = 0; |
| 65 | 67 |
| 66 // Body consumption algorithms will reject with a TypeError in a number of | 68 // Body consumption algorithms will reject with a TypeError in a number of |
| 67 // error conditions. This method wraps those up into one call which returns | 69 // error conditions. This method wraps those up into one call which returns |
| 68 // an empty ScriptPromise if the consumption may proceed, and a | 70 // an empty ScriptPromise if the consumption may proceed, and a |
| 69 // ScriptPromise rejected with a TypeError if it ought to be blocked. | 71 // ScriptPromise rejected with a TypeError if it ought to be blocked. |
| 70 ScriptPromise rejectInvalidConsumption(ScriptState*); | 72 ScriptPromise rejectInvalidConsumption(ScriptState*); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace blink | 75 } // namespace blink |
| 74 | 76 |
| 75 #endif // Body_h | 77 #endif // Body_h |
| OLD | NEW |