| 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 #include "core/streams/ReadableStreamOperations.h" | 5 #include "core/streams/ReadableStreamOperations.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "bindings/core/v8/ToV8.h" | 9 #include "bindings/core/v8/ToV8.h" |
| 10 #include "bindings/core/v8/V8ScriptRunner.h" | 10 #include "bindings/core/v8/V8ScriptRunner.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool ReadableStreamOperations::isDisturbed(ScriptState* scriptState, ScriptValue
stream) | 60 bool ReadableStreamOperations::isDisturbed(ScriptState* scriptState, ScriptValue
stream) |
| 61 { | 61 { |
| 62 ASSERT(isReadableStream(scriptState, stream)); | 62 ASSERT(isReadableStream(scriptState, stream)); |
| 63 | 63 |
| 64 v8::Local<v8::Value> args[] = { stream.v8Value() }; | 64 v8::Local<v8::Value> args[] = { stream.v8Value() }; |
| 65 return V8ScriptRunner::callExtraOrCrash(scriptState, "IsReadableStreamDistur
bed", args)->ToBoolean()->Value(); | 65 return V8ScriptRunner::callExtraOrCrash(scriptState, "IsReadableStreamDistur
bed", args)->ToBoolean()->Value(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ReadableStreamOperations::setDisturbed(ScriptState* scriptState, ScriptValu
e stream) | |
| 69 { | |
| 70 ASSERT(isReadableStream(scriptState, stream)); | |
| 71 | |
| 72 v8::Local<v8::Value> args[] = { stream.v8Value() }; | |
| 73 V8ScriptRunner::callExtraOrCrash(scriptState, "SetReadableStreamDisturbed",
args); | |
| 74 } | |
| 75 | |
| 76 bool ReadableStreamOperations::isLocked(ScriptState* scriptState, ScriptValue st
ream) | 68 bool ReadableStreamOperations::isLocked(ScriptState* scriptState, ScriptValue st
ream) |
| 77 { | 69 { |
| 78 ASSERT(isReadableStream(scriptState, stream)); | 70 ASSERT(isReadableStream(scriptState, stream)); |
| 79 | 71 |
| 80 v8::Local<v8::Value> args[] = { stream.v8Value() }; | 72 v8::Local<v8::Value> args[] = { stream.v8Value() }; |
| 81 return V8ScriptRunner::callExtraOrCrash(scriptState, "IsReadableStreamLocked
", args)->ToBoolean()->Value(); | 73 return V8ScriptRunner::callExtraOrCrash(scriptState, "IsReadableStreamLocked
", args)->ToBoolean()->Value(); |
| 82 } | 74 } |
| 83 | 75 |
| 84 bool ReadableStreamOperations::isReadable(ScriptState* scriptState, ScriptValue
stream) | 76 bool ReadableStreamOperations::isReadable(ScriptState* scriptState, ScriptValue
stream) |
| 85 { | 77 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 ScriptPromise ReadableStreamOperations::read(ScriptState* scriptState, ScriptVal
ue reader) | 111 ScriptPromise ReadableStreamOperations::read(ScriptState* scriptState, ScriptVal
ue reader) |
| 120 { | 112 { |
| 121 ASSERT(isReadableStreamReader(scriptState, reader)); | 113 ASSERT(isReadableStreamReader(scriptState, reader)); |
| 122 | 114 |
| 123 v8::Local<v8::Value> args[] = { reader.v8Value() }; | 115 v8::Local<v8::Value> args[] = { reader.v8Value() }; |
| 124 return ScriptPromise::cast(scriptState, V8ScriptRunner::callExtraOrCrash(scr
iptState, "ReadFromReadableStreamReader", args)); | 116 return ScriptPromise::cast(scriptState, V8ScriptRunner::callExtraOrCrash(scr
iptState, "ReadFromReadableStreamReader", args)); |
| 125 } | 117 } |
| 126 | 118 |
| 127 } // namespace blink | 119 } // namespace blink |
| 128 | 120 |
| OLD | NEW |