| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 NET_QUIC_QUARTC_QUARTC_STREAM_H_ | 5 #ifndef NET_QUIC_QUARTC_QUARTC_STREAM_H_ |
| 6 #define NET_QUIC_QUARTC_QUARTC_STREAM_H_ | 6 #define NET_QUIC_QUARTC_QUARTC_STREAM_H_ |
| 7 | 7 |
| 8 #include "net/quic/core/quic_session.h" | 8 #include "net/quic/core/quic_session.h" |
| 9 #include "net/quic/core/quic_stream.h" | 9 #include "net/quic/core/quic_stream.h" |
| 10 #include "net/quic/quartc/quartc_stream_interface.h" | 10 #include "net/quic/quartc/quartc_stream_interface.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // Implements a QuartcStreamInterface using a QuicStream. | 14 // Implements a QuartcStreamInterface using a QuicStream. |
| 15 class QuartcStream : public QuicStream, public QuartcStreamInterface { | 15 class QUIC_EXPORT_PRIVATE QuartcStream : public QuicStream, |
| 16 public QuartcStreamInterface { |
| 16 public: | 17 public: |
| 17 QuartcStream(QuicStreamId id, QuicSession* session); | 18 QuartcStream(QuicStreamId id, QuicSession* session); |
| 18 | 19 |
| 19 ~QuartcStream() override; | 20 ~QuartcStream() override; |
| 20 | 21 |
| 21 // QuicStream overrides. | 22 // QuicStream overrides. |
| 22 void OnDataAvailable() override; | 23 void OnDataAvailable() override; |
| 23 | 24 |
| 24 void OnClose() override; | 25 void OnClose() override; |
| 25 | 26 |
| 26 void OnCanWrite() override; | 27 void OnCanWrite() override; |
| 27 | 28 |
| 28 // QuartcStreamInterface overrides. | 29 // QuartcStreamInterface overrides. |
| 29 uint32_t stream_id() override; | 30 uint32_t stream_id() override; |
| 30 | 31 |
| 31 uint64_t buffered_amount() override; | 32 uint64_t buffered_amount() override; |
| 32 | 33 |
| 33 bool fin_sent() override; | 34 bool fin_sent() override; |
| 34 | 35 |
| 36 int stream_error() override; |
| 37 |
| 38 int connection_error() override; |
| 39 |
| 35 void Write(const char* data, | 40 void Write(const char* data, |
| 36 size_t size, | 41 size_t size, |
| 37 const WriteParameters& param) override; | 42 const WriteParameters& param) override; |
| 38 | 43 |
| 39 void Close() override; | 44 void Close() override; |
| 40 | 45 |
| 41 void SetDelegate(QuartcStreamInterface::Delegate* delegate) override; | 46 void SetDelegate(QuartcStreamInterface::Delegate* delegate) override; |
| 42 | 47 |
| 43 private: | 48 private: |
| 44 QuartcStreamInterface::Delegate* delegate_ = nullptr; | 49 QuartcStreamInterface::Delegate* delegate_ = nullptr; |
| 45 }; | 50 }; |
| 46 | 51 |
| 47 } // namespace net | 52 } // namespace net |
| 48 | 53 |
| 49 #endif // NET_QUIC_QUARTC_QUARTC_STREAM_H_ | 54 #endif // NET_QUIC_QUARTC_QUARTC_STREAM_H_ |
| OLD | NEW |