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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // This class represents Body mix-in defined in the fetch spec | 23 // This class represents Body mix-in defined in the fetch spec |
24 // https://fetch.spec.whatwg.org/#body-mixin. | 24 // https://fetch.spec.whatwg.org/#body-mixin. |
25 // | 25 // |
26 // Note: This class has body stream and its predicate whereas in the current | 26 // Note: This class has body stream and its predicate whereas in the current |
27 // spec only Response has it and Request has a byte stream defined in the | 27 // spec only Response has it and Request has a byte stream defined in the |
28 // Encoding spec. The spec should be fixed shortly to be aligned with this | 28 // Encoding spec. The spec should be fixed shortly to be aligned with this |
29 // implementation. | 29 // implementation. |
30 class MODULES_EXPORT Body : public GarbageCollected<Body>, | 30 class MODULES_EXPORT Body : public GarbageCollected<Body>, |
31 public ScriptWrappable, | 31 public ScriptWrappable, |
32 public ActiveScriptWrappable, | 32 public ActiveScriptWrappable<Body>, |
33 public ContextLifecycleObserver { | 33 public ContextLifecycleObserver { |
34 WTF_MAKE_NONCOPYABLE(Body); | 34 WTF_MAKE_NONCOPYABLE(Body); |
35 DEFINE_WRAPPERTYPEINFO(); | 35 DEFINE_WRAPPERTYPEINFO(); |
36 USING_GARBAGE_COLLECTED_MIXIN(Body); | 36 USING_GARBAGE_COLLECTED_MIXIN(Body); |
37 | 37 |
38 public: | 38 public: |
39 explicit Body(ExecutionContext*); | 39 explicit Body(ExecutionContext*); |
40 | 40 |
41 ScriptPromise arrayBuffer(ScriptState*); | 41 ScriptPromise arrayBuffer(ScriptState*); |
42 ScriptPromise blob(ScriptState*); | 42 ScriptPromise blob(ScriptState*); |
(...skipping 18 matching lines...) Expand all Loading... |
61 // Body consumption algorithms will reject with a TypeError in a number of | 61 // Body consumption algorithms will reject with a TypeError in a number of |
62 // error conditions. This method wraps those up into one call which returns | 62 // error conditions. This method wraps those up into one call which returns |
63 // an empty ScriptPromise if the consumption may proceed, and a | 63 // an empty ScriptPromise if the consumption may proceed, and a |
64 // ScriptPromise rejected with a TypeError if it ought to be blocked. | 64 // ScriptPromise rejected with a TypeError if it ought to be blocked. |
65 ScriptPromise rejectInvalidConsumption(ScriptState*); | 65 ScriptPromise rejectInvalidConsumption(ScriptState*); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
69 | 69 |
70 #endif // Body_h | 70 #endif // Body_h |
OLD | NEW |