OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ReadableStreamTestSource_h |
| 6 #define ReadableStreamTestSource_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" |
| 11 #include "core/streams/ReadableStreamController.h" |
| 12 #include "core/streams/UnderlyingSourceBase.h" |
| 13 #include "platform/heap/Handle.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class ReadableStreamTestSource final : public UnderlyingSourceBase { |
| 18 DEFINE_WRAPPERTYPEINFO(); |
| 19 |
| 20 public: |
| 21 ReadableStreamTestSource(ScriptState* scriptState) : UnderlyingSourceBase(sc
riptState) { } |
| 22 |
| 23 void enqueue(ScriptValue v) { controller()->enqueue(v); } |
| 24 void close() { controller()->close(); } |
| 25 void error(ScriptValue e) { controller()->error(e); } |
| 26 }; |
| 27 |
| 28 } // namespace blink |
| 29 |
| 30 #endif // ReadableStreamTestSource_h |
OLD | NEW |