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" |
11 #include "bindings/core/v8/V8Binding.h" | 11 #include "bindings/core/v8/V8Binding.h" |
12 #include "core/dom/DOMException.h" | 12 #include "core/dom/DOMException.h" |
13 #include "core/dom/ExceptionCode.h" | 13 #include "core/dom/ExceptionCode.h" |
14 #include "core/dom/ExecutionContext.h" | 14 #include "core/dom/ExecutionContext.h" |
15 #include "core/streams/UnderlyingSource.h" | 15 #include "core/streams/UnderlyingSource.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 ReadableStream::ReadableStream(ExecutionContext* executionContext, UnderlyingSou
rce* source) | 19 ReadableStream::ReadableStream(ExecutionContext* executionContext, UnderlyingSou
rce* source) |
20 : m_source(source) | 20 : m_source(source) |
21 , m_isStarted(false) | 21 , m_isStarted(false) |
22 , m_isDraining(false) | 22 , m_isDraining(false) |
23 , m_isPulling(false) | 23 , m_isPulling(false) |
24 , m_isSchedulingPull(false) | 24 , m_isSchedulingPull(false) |
25 , m_state(Waiting) | 25 , m_state(Waiting) |
26 , m_wait(new WaitPromise(executionContext, this, WaitPromise::Ready)) | 26 , m_wait(new WaitPromise(executionContext, this, WaitPromise::Ready)) |
27 , m_closed(new ClosedPromise(executionContext, this, ClosedPromise::Closed)) | 27 , m_closed(new ClosedPromise(executionContext, this, ClosedPromise::Closed)) |
28 { | 28 { |
29 ScriptWrappable::init(this); | |
30 } | 29 } |
31 | 30 |
32 ReadableStream::~ReadableStream() | 31 ReadableStream::~ReadableStream() |
33 { | 32 { |
34 } | 33 } |
35 | 34 |
36 String ReadableStream::stateString() const | 35 String ReadableStream::stateString() const |
37 { | 36 { |
38 switch (m_state) { | 37 switch (m_state) { |
39 case Readable: | 38 case Readable: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void ReadableStream::trace(Visitor* visitor) | 190 void ReadableStream::trace(Visitor* visitor) |
192 { | 191 { |
193 visitor->trace(m_source); | 192 visitor->trace(m_source); |
194 visitor->trace(m_wait); | 193 visitor->trace(m_wait); |
195 visitor->trace(m_closed); | 194 visitor->trace(m_closed); |
196 visitor->trace(m_exception); | 195 visitor->trace(m_exception); |
197 } | 196 } |
198 | 197 |
199 } // namespace blink | 198 } // namespace blink |
200 | 199 |
OLD | NEW |