OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "core/streams/ReadableStream.h" | 6 #include "core/streams/ReadableStream.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 9 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 return cancelInternal(scriptState, reason); | 107 return cancelInternal(scriptState, reason); |
108 } | 108 } |
109 | 109 |
110 ScriptPromise ReadableStream::cancelInternal(ScriptState* scriptState, ScriptVal
ue reason) | 110 ScriptPromise ReadableStream::cancelInternal(ScriptState* scriptState, ScriptVal
ue reason) |
111 { | 111 { |
112 closeInternal(); | 112 closeInternal(); |
113 return m_source->cancelSource(scriptState, reason).then(ConstUndefined::crea
te(scriptState)); | 113 return m_source->cancelSource(scriptState, reason).then(ConstUndefined::crea
te(scriptState)); |
114 } | 114 } |
115 | 115 |
116 void ReadableStream::error(PassRefPtrWillBeRawPtr<DOMException> exception) | 116 void ReadableStream::error(DOMException* exception) |
117 { | 117 { |
118 if (m_state != ReadableStream::Readable) | 118 if (m_state != ReadableStream::Readable) |
119 return; | 119 return; |
120 | 120 |
121 m_exception = exception; | 121 m_exception = exception; |
122 clearQueue(); | 122 clearQueue(); |
123 rejectAllPendingReads(m_exception); | 123 rejectAllPendingReads(m_exception); |
124 m_state = Errored; | 124 m_state = Errored; |
125 if (m_reader) | 125 if (m_reader) |
126 m_reader->releaseLock(); | 126 m_reader->releaseLock(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 | 182 |
183 DEFINE_TRACE(ReadableStream) | 183 DEFINE_TRACE(ReadableStream) |
184 { | 184 { |
185 visitor->trace(m_source); | 185 visitor->trace(m_source); |
186 visitor->trace(m_exception); | 186 visitor->trace(m_exception); |
187 visitor->trace(m_reader); | 187 visitor->trace(m_reader); |
188 } | 188 } |
189 | 189 |
190 } // namespace blink | 190 } // namespace blink |
OLD | NEW |