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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperations.h

Issue 1167343002: Add methods for creating V8 extras-based ReadableStreams from C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on smaller CLs; move ReadableStreamController Created 4 years, 11 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ReadableStreamOperations_h 5 #ifndef ReadableStreamOperations_h
6 #define ReadableStreamOperations_h 6 #define ReadableStreamOperations_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include <v8.h> 10 #include <v8.h>
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class UnderlyingSourceBase;
14 class ExceptionState; 15 class ExceptionState;
15 class ScriptState; 16 class ScriptState;
16 17
17 // This class has various methods for ReadableStream[Reader] implemented with 18 // This class has various methods for ReadableStream[Reader] implemented with
18 // V8 Extras. 19 // V8 Extras.
19 // All methods should be called in an appropriate V8 context. All ScriptValue 20 // All methods should be called in an appropriate V8 context. All ScriptValue
20 // arguments must not be empty. 21 // arguments must not be empty.
21 class CORE_EXPORT ReadableStreamOperations { 22 class CORE_EXPORT ReadableStreamOperations {
22 STATIC_ONLY(ReadableStreamOperations); 23 STATIC_ONLY(ReadableStreamOperations);
23 public: 24 public:
25 // createReadableStreamWithExternalController
26 static ScriptValue createReadableStream(ScriptState*, UnderlyingSourceBase*, ScriptValue strategy);
27
28 // createBuiltInCountQueuingStrategy
29 static ScriptValue createCountQueuingStrategy(ScriptState*, size_t highWater Mark);
30
24 // AcquireReadableStreamReader 31 // AcquireReadableStreamReader
25 // This function assumes |isReadableStream(stream)|. 32 // This function assumes |isReadableStream(stream)|.
26 // Returns an empty value and throws an error via the ExceptionState when 33 // Returns an empty value and throws an error via the ExceptionState when
27 // errored. 34 // errored.
28 static ScriptValue getReader(ScriptState*, ScriptValue stream, ExceptionStat e&); 35 static ScriptValue getReader(ScriptState*, ScriptValue stream, ExceptionStat e&);
29 36
30 // IsReadableStream 37 // IsReadableStream
31 static bool isReadableStream(ScriptState*, ScriptValue); 38 static bool isReadableStream(ScriptState*, ScriptValue);
32 39
33 // IsReadableStreamDisturbed 40 // IsReadableStreamDisturbed
34 // This function assumes |isReadableStream(stream)|. 41 // This function assumes |isReadableStream(stream)|.
35 static bool isDisturbed(ScriptState*, ScriptValue stream); 42 static bool isDisturbed(ScriptState*, ScriptValue stream);
36 43
37 // IsReadableStreamLocked 44 // IsReadableStreamLocked
38 // This function assumes |isReadableStream(stream)|. 45 // This function assumes |isReadableStream(stream)|.
39 static bool isLocked(ScriptState*, ScriptValue stream); 46 static bool isLocked(ScriptState*, ScriptValue stream);
40 47
41 // IsReadableStreamReader 48 // IsReadableStreamReader
42 static bool isReadableStreamReader(ScriptState*, ScriptValue); 49 static bool isReadableStreamReader(ScriptState*, ScriptValue);
43 50
44 // ReadFromReadableStreamReader 51 // ReadFromReadableStreamReader
45 // This function assumes |isReadableStreamReader(reader)|. 52 // This function assumes |isReadableStreamReader(reader)|.
46 static ScriptPromise read(ScriptState*, ScriptValue reader); 53 static ScriptPromise read(ScriptState*, ScriptValue reader);
47 }; 54 };
48 55
49 } // namespace blink 56 } // namespace blink
50 57
51 #endif // ReadableStreamOperations_h 58 #endif // ReadableStreamOperations_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698