OLD | NEW |
(Empty) | |
| 1 #ifndef ScriptUnderlyingSource_h |
| 2 #define ScriptUnderlyingSource_h |
| 3 |
| 4 #include "bindings/core/v8/ScriptPromise.h" |
| 5 #include "bindings/core/v8/ScriptValue.h" |
| 6 #include "bindings/core/v8/ScriptWrappable.h" |
| 7 #include "core/streams/ScriptReadableStreamController.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 // TODO do we need ActiveDOMObject?? |
| 12 |
| 13 class CORE_EXPORT ScriptUnderlyingSource : public GarbageCollectedFinalized<Scri
ptUnderlyingSource>, public ScriptWrappable { |
| 14 DEFINE_WRAPPERTYPEINFO(); |
| 15 |
| 16 public: |
| 17 ScriptPromise start(ScriptValue stream); |
| 18 ScriptPromise pull(); |
| 19 ScriptPromise cancel(ScriptValue reason); |
| 20 |
| 21 DECLARE_VIRTUAL_TRACE(); |
| 22 |
| 23 protected: |
| 24 virtual ScriptPromise startImpl() = 0; |
| 25 virtual ScriptPromise pullImpl() = 0; |
| 26 virtual ScriptPromise cancelImpl(ScriptValue reason) = 0; |
| 27 |
| 28 // TODO is a reference a good idea? |
| 29 ScriptReadableStreamController& controller() const { return *m_controller; } |
| 30 |
| 31 private: |
| 32 // TODO should be using a smart pointer of some sort ... Member<>? Persisten
t<>? RefPtr<>? |
| 33 // ScriptReadableStreamController is not GarbageCollectedFinalized<>... if w
e made it so, how do we handle it |
| 34 // containing a ScriptValue? |
| 35 ScriptReadableStreamController* m_controller; |
| 36 }; |
| 37 |
| 38 } // namespace blink |
| 39 |
| 40 #endif ScriptUnderlyingSource_h |
OLD | NEW |