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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 ScriptPromise formData(ScriptState*); | 44 ScriptPromise formData(ScriptState*); |
45 ScriptPromise json(ScriptState*); | 45 ScriptPromise json(ScriptState*); |
46 ScriptPromise text(ScriptState*); | 46 ScriptPromise text(ScriptState*); |
47 ScriptValue bodyWithUseCounter(ScriptState*); | 47 ScriptValue bodyWithUseCounter(ScriptState*); |
48 virtual BodyStreamBuffer* bodyBuffer() = 0; | 48 virtual BodyStreamBuffer* bodyBuffer() = 0; |
49 virtual const BodyStreamBuffer* bodyBuffer() const = 0; | 49 virtual const BodyStreamBuffer* bodyBuffer() const = 0; |
50 | 50 |
51 virtual bool bodyUsed(); | 51 virtual bool bodyUsed(); |
52 bool isBodyLocked(); | 52 bool isBodyLocked(); |
53 | 53 |
54 // ActiveScriptWrappable override. | 54 // ScriptWrappable override. |
55 bool hasPendingActivity() const override; | 55 bool hasPendingActivity() const override; |
56 | 56 |
57 DEFINE_INLINE_VIRTUAL_TRACE() | 57 DEFINE_INLINE_VIRTUAL_TRACE() |
58 { | 58 { |
59 ContextLifecycleObserver::trace(visitor); | 59 ContextLifecycleObserver::trace(visitor); |
60 } | 60 } |
61 | 61 |
62 private: | 62 private: |
63 virtual String mimeType() const = 0; | 63 virtual String mimeType() const = 0; |
64 | 64 |
65 // Body consumption algorithms will reject with a TypeError in a number of | 65 // Body consumption algorithms will reject with a TypeError in a number of |
66 // error conditions. This method wraps those up into one call which returns | 66 // error conditions. This method wraps those up into one call which returns |
67 // an empty ScriptPromise if the consumption may proceed, and a | 67 // an empty ScriptPromise if the consumption may proceed, and a |
68 // ScriptPromise rejected with a TypeError if it ought to be blocked. | 68 // ScriptPromise rejected with a TypeError if it ought to be blocked. |
69 ScriptPromise rejectInvalidConsumption(ScriptState*); | 69 ScriptPromise rejectInvalidConsumption(ScriptState*); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif // Body_h | 74 #endif // Body_h |
OLD | NEW |