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

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

Issue 1492763002: Add a utility class to call stream methods implemented with v8 extras. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-extra-switch
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperations.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef ReadableStreamOperations_h
6 #define ReadableStreamOperations_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptValue.h"
10 #include <v8.h>
11
12 namespace blink {
13
14 class ExceptionState;
15 class ScriptState;
16
17 // This class has various methods for ReadableStream[Reader] implemented with
18 // V8 Extras.
19 // All methods should be called in an appropriate V8 context. All v8 handle
20 // arguments must not be empty.
21 class CORE_EXPORT ReadableStreamOperations {
22 STATIC_ONLY(ReadableStreamOperations);
23 public:
24 // AcquireReadableStreamReader
25 // This function assumes |isReadableStream(stream)|.
26 // Returns an empty value and throws an error via the ExceptionState when
27 // errored.
28 static ScriptValue getReader(ScriptState*, v8::Local<v8::Value> stream, Exce ptionState&);
29
30 // IsReadableStream
31 static bool isReadableStream(ScriptState*, v8::Local<v8::Value>);
32
33 // IsReadableStreamDisturbed
34 // This function assumes |isReadableStream(stream)|.
35 static bool isDisturbed(ScriptState*, v8::Local<v8::Value> stream);
36
37 // IsReadableStreamLocked
38 // This function assumes |isReadableStream(stream)|.
39 static bool isLocked(ScriptState*, v8::Local<v8::Value> stream);
40
41 // IsReadableStreamReader
42 static bool isReadableStreamReader(ScriptState*, v8::Local<v8::Value>);
43
44 // ReadFromReadableStreamReader
45 // This function assumes |isReadableStreamReader(reader)|.
46 static ScriptPromise read(ScriptState*, v8::Local<v8::Value> reader);
47 };
48
49 } // namespace blink
50
51 #endif // ReadableStreamOperations_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698