OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/UnderlyingSourceBase.h" | 5 #include "core/streams/UnderlyingSourceBase.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "core/streams/ReadableStreamController.h" | 10 #include "core/streams/ReadableStreamController.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 bool UnderlyingSourceBase::hasPendingActivity() const | 49 bool UnderlyingSourceBase::hasPendingActivity() const |
50 { | 50 { |
51 // This will return false within a finite time period _assuming_ that | 51 // This will return false within a finite time period _assuming_ that |
52 // consumers use the controller to close or error the stream. | 52 // consumers use the controller to close or error the stream. |
53 // Browser-created readable streams should always close or error within a | 53 // Browser-created readable streams should always close or error within a |
54 // finite time period, due to timeouts etc. | 54 // finite time period, due to timeouts etc. |
55 return m_controller && m_controller->isActive(); | 55 return m_controller && m_controller->isActive(); |
56 } | 56 } |
57 | 57 |
58 void UnderlyingSourceBase::contextDestroyed() | 58 void UnderlyingSourceBase::stop() |
59 { | 59 { |
60 m_controller->noteHasBeenCanceled(); | 60 m_controller->noteHasBeenCanceled(); |
61 m_controller.clear(); | 61 m_controller.clear(); |
62 } | 62 } |
63 | 63 |
64 DEFINE_TRACE(UnderlyingSourceBase) | 64 DEFINE_TRACE(UnderlyingSourceBase) |
65 { | 65 { |
| 66 ActiveDOMObject::trace(visitor); |
66 visitor->trace(m_controller); | 67 visitor->trace(m_controller); |
67 ContextLifecycleObserver::trace(visitor); | |
68 } | 68 } |
69 | 69 |
70 } // namespace blink | 70 } // namespace blink |
OLD | NEW |