Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: Source/core/streams/ScriptReadableStream.cpp

Issue 1118673002: Implement ReadableStream as a V8 extra (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanups; make controller a member instead of arg Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « Source/core/streams/ScriptReadableStream.h ('k') | Source/core/streams/ScriptReadableStreamController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698