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 #include "config.h" |
| 6 #include "core/streams/UnderlyingSourceBase.h" |
| 7 |
| 8 #include <v8.h> |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 ScriptPromise UnderlyingSourceBase::startWrapper(ScriptState* scriptState, Scrip
tValue stream) |
| 13 { |
| 14 // In ReadableStream.js, we special-case externally-controlled streams by ha
ving them pass themselves to start |
| 15 // as the first argument. This allows us to create a ScriptReadableStreamCon
troller. |
| 16 |
| 17 // TODO pointer usage here is presumably very borked |
| 18 m_controller = new ReadableStreamController(stream); |
| 19 |
| 20 return start(scriptState); |
| 21 } |
| 22 |
| 23 ScriptPromise UnderlyingSourceBase::start(ScriptState* scriptState) |
| 24 { |
| 25 return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate()
)); |
| 26 } |
| 27 |
| 28 ScriptPromise UnderlyingSourceBase::pull(ScriptState* scriptState) |
| 29 { |
| 30 return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate()
)); |
| 31 } |
| 32 |
| 33 ScriptPromise UnderlyingSourceBase::cancel(ScriptState* scriptState, ScriptValue
reason) |
| 34 { |
| 35 return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate()
)); |
| 36 } |
| 37 |
| 38 DEFINE_TRACE(UnderlyingSourceBase) |
| 39 { |
| 40 } |
| 41 |
| 42 } // namespace blink |
OLD | NEW |