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/ScriptReadableStream.h" |
| 7 |
| 8 #include "bindings/core/v8/ToV8.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 ScriptReadableStream::ScriptReadableStream(ScriptState* scriptState, ScriptUnder
lyingSource* underlyingSource, ScriptQueuingStrategy* strategy) |
| 13 { |
| 14 ScriptState::Scope scope(scriptState); |
| 15 |
| 16 auto global = scriptState->context()->Global(); |
| 17 auto isolate = scriptState->isolate(); |
| 18 |
| 19 auto jsUnderlyingSource = toV8(underlyingSource, global, isolate); |
| 20 auto jsStrategy = toV8(strategy, global, isolate); |
| 21 |
| 22 auto sentinel = scriptState->getFromExtrasExports("createWithExternalControl
lerSentinel").v8Value(); |
| 23 auto constructor = scriptState->getFromExtrasExports("ReadableStream").v8Val
ue().As<v8::Function>(); |
| 24 |
| 25 v8::Local<v8::Value> args[] = { jsUnderlyingSource, jsStrategy, sentinel }; |
| 26 auto jsStream = constructor->NewInstance(3, args); |
| 27 |
| 28 m_stream = ScriptValue(scriptState, jsStream); |
| 29 } |
| 30 |
| 31 } |
OLD | NEW |