Index: Source/core/streams/UnderlyingSourceBase.cpp |
diff --git a/Source/core/streams/UnderlyingSourceBase.cpp b/Source/core/streams/UnderlyingSourceBase.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..228ba995cf048a6fb1edcf1b4c295d5127dee5cf |
--- /dev/null |
+++ b/Source/core/streams/UnderlyingSourceBase.cpp |
@@ -0,0 +1,42 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/streams/UnderlyingSourceBase.h" |
+ |
+#include <v8.h> |
+ |
+namespace blink { |
+ |
+ScriptPromise UnderlyingSourceBase::startWrapper(ScriptState* scriptState, ScriptValue stream) |
+{ |
+ // In ReadableStream.js, we special-case externally-controlled streams by having them pass themselves to start |
+ // as the first argument. This allows us to create a ScriptReadableStreamController. |
+ |
+ // TODO pointer usage here is presumably very borked |
+ m_controller = new ReadableStreamController(stream); |
+ |
+ return start(scriptState); |
+} |
+ |
+ScriptPromise UnderlyingSourceBase::start(ScriptState* scriptState) |
+{ |
+ return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); |
+} |
+ |
+ScriptPromise UnderlyingSourceBase::pull(ScriptState* scriptState) |
+{ |
+ return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); |
+} |
+ |
+ScriptPromise UnderlyingSourceBase::cancel(ScriptState* scriptState, ScriptValue reason) |
+{ |
+ return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); |
+} |
+ |
+DEFINE_TRACE(UnderlyingSourceBase) |
+{ |
+} |
+ |
+} // namespace blink |