| 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; } |
| 72 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader
== reader; } | 74 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader
== reader; } |
| 73 | 75 |
| 74 bool hasPendingActivity() const override; | 76 bool hasPendingActivity() const override; |
| 75 void stop() override; | 77 void stop() override; |
| 76 DECLARE_VIRTUAL_TRACE(); | 78 DECLARE_VIRTUAL_TRACE(); |
| 77 | 79 |
| 78 // Returns the string representation of the given State. | 80 // Returns the string representation of the given State. |
| 79 static String stateToString(State); | 81 static String stateToString(State); |
| 80 | 82 |
| 81 protected: | 83 protected: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 104 Member<WaitPromise> m_ready; | 106 Member<WaitPromise> m_ready; |
| 105 Member<ClosedPromise> m_closed; | 107 Member<ClosedPromise> m_closed; |
| 106 | 108 |
| 107 RefPtrWillBeMember<DOMException> m_exception; | 109 RefPtrWillBeMember<DOMException> m_exception; |
| 108 Member<ExclusiveStreamReader> m_reader; | 110 Member<ExclusiveStreamReader> m_reader; |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // namespace blink | 113 } // namespace blink |
| 112 | 114 |
| 113 #endif // ReadableStream_h | 115 #endif // ReadableStream_h |
| OLD | NEW |