Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 STATIC_ONLY(ReadableStreamOperations); | 23 STATIC_ONLY(ReadableStreamOperations); |
| 24 public: | 24 public: |
| 25 // createReadableStreamWithExternalController | 25 // createReadableStreamWithExternalController |
| 26 // If the caller supplies an invalid strategy (e.g. one that returns | 26 // If the caller supplies an invalid strategy (e.g. one that returns |
| 27 // negative sizes, or doesn't have appropriate properties), this will crash. | 27 // negative sizes, or doesn't have appropriate properties), this will crash. |
| 28 static ScriptValue createReadableStream(ScriptState*, UnderlyingSourceBase*, ScriptValue strategy); | 28 static ScriptValue createReadableStream(ScriptState*, UnderlyingSourceBase*, ScriptValue strategy); |
| 29 | 29 |
| 30 // createBuiltInCountQueuingStrategy | 30 // createBuiltInCountQueuingStrategy |
| 31 static ScriptValue createCountQueuingStrategy(ScriptState*, size_t highWater Mark); | 31 static ScriptValue createCountQueuingStrategy(ScriptState*, size_t highWater Mark); |
| 32 | 32 |
| 33 // AcquireReadableStreamReader | 33 // AcquireReadableStreamDefaultReader |
| 34 // This function assumes |isReadableStream(stream)|. | 34 // This function assumes |isReadableStream(stream)|. |
| 35 // Returns an empty value and throws an error via the ExceptionState when | 35 // Returns an empty value and throws an error via the ExceptionState when |
| 36 // errored. | 36 // errored. |
| 37 static ScriptValue getReader(ScriptState*, ScriptValue stream, ExceptionStat e&); | 37 static ScriptValue getReader(ScriptState*, ScriptValue stream, ExceptionStat e&); |
| 38 | 38 |
| 39 // IsReadableStream | 39 // IsReadableStream |
| 40 static bool isReadableStream(ScriptState*, ScriptValue); | 40 static bool isReadableStream(ScriptState*, ScriptValue); |
| 41 | 41 |
| 42 // IsReadableStreamDisturbed | 42 // IsReadableStreamDisturbed |
| 43 // This function assumes |isReadableStream(stream)|. | 43 // This function assumes |isReadableStream(stream)|. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 56 static bool isReadable(ScriptState*, ScriptValue stream); | 56 static bool isReadable(ScriptState*, ScriptValue stream); |
| 57 | 57 |
| 58 // IsReadableStreamClosed | 58 // IsReadableStreamClosed |
| 59 // This function assumes |isReadableStream(stream)|. | 59 // This function assumes |isReadableStream(stream)|. |
| 60 static bool isClosed(ScriptState*, ScriptValue stream); | 60 static bool isClosed(ScriptState*, ScriptValue stream); |
| 61 | 61 |
| 62 // IsReadableStreamErrored | 62 // IsReadableStreamErrored |
| 63 // This function assumes |isReadableStream(stream)|. | 63 // This function assumes |isReadableStream(stream)|. |
| 64 static bool isErrored(ScriptState*, ScriptValue stream); | 64 static bool isErrored(ScriptState*, ScriptValue stream); |
| 65 | 65 |
| 66 // IsReadableStreamReader | 66 // IsReadableStreamDefaultReader |
| 67 static bool isReadableStreamReader(ScriptState*, ScriptValue); | 67 static bool isReadableStreamDefaultReader(ScriptState*, ScriptValue); |
| 68 | 68 |
| 69 // ReadFromReadableStreamReader | 69 // ReadableStreamDefaultReaderRead |
| 70 // This function assumes |isReadableStreamReader(reader)|. | 70 // This function assumes |isReadableStreamDefaultReader(reader)|. |
| 71 static ScriptPromise read(ScriptState*, ScriptValue reader); | 71 static ScriptPromise read(ScriptState*, ScriptValue reader); |
|
domenic
2016/04/27 21:12:24
Maybe this should be named defaultReaderRead now
tyoshino (SeeGerritForStatus)
2016/04/28 14:51:11
Done.
| |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 #endif // ReadableStreamOperations_h | 76 #endif // ReadableStreamOperations_h |
| OLD | NEW |