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 #ifndef ReadableStream_h | 5 #ifndef ReadableStream_h |
6 #define ReadableStream_h | 6 #define ReadableStream_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseProperty.h" | 9 #include "bindings/core/v8/ScriptPromiseProperty.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void close(); | 62 void close(); |
63 void error(PassRefPtrWillBeRawPtr<DOMException>); | 63 void error(PassRefPtrWillBeRawPtr<DOMException>); |
64 | 64 |
65 void didSourceStart(); | 65 void didSourceStart(); |
66 | 66 |
67 // This function is not a getter. It creates an ExclusiveStreamReader and | 67 // This function is not a getter. It creates an ExclusiveStreamReader and |
68 // returns it. | 68 // returns it. |
69 ExclusiveStreamReader* getReader(ExceptionState&); | 69 ExclusiveStreamReader* getReader(ExceptionState&); |
70 // Only ExclusiveStreamReader methods should call this function. | 70 // Only ExclusiveStreamReader methods should call this function. |
71 void setReader(ExclusiveStreamReader*); | 71 void setReader(ExclusiveStreamReader*); |
72 | |
73 bool isLocked() const { return m_reader; } | |
74 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader
== reader; } | 72 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader
== reader; } |
75 | 73 |
76 bool hasPendingActivity() const override; | 74 bool hasPendingActivity() const override; |
77 void trace(Visitor*) override; | 75 void trace(Visitor*) override; |
78 | 76 |
79 // Returns the string representation of the given State. | 77 // Returns the string representation of the given State. |
80 static String stateToString(State); | 78 static String stateToString(State); |
81 | 79 |
82 protected: | 80 protected: |
83 bool enqueuePreliminaryCheck(); | 81 bool enqueuePreliminaryCheck(); |
(...skipping 21 matching lines...) Expand all Loading... |
105 Member<WaitPromise> m_ready; | 103 Member<WaitPromise> m_ready; |
106 Member<ClosedPromise> m_closed; | 104 Member<ClosedPromise> m_closed; |
107 | 105 |
108 RefPtrWillBeMember<DOMException> m_exception; | 106 RefPtrWillBeMember<DOMException> m_exception; |
109 Member<ExclusiveStreamReader> m_reader; | 107 Member<ExclusiveStreamReader> m_reader; |
110 }; | 108 }; |
111 | 109 |
112 } // namespace blink | 110 } // namespace blink |
113 | 111 |
114 #endif // ReadableStream_h | 112 #endif // ReadableStream_h |
OLD | NEW |