OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_P2P_QUIC_RELIABLEQUICSTREAM_H_ |
| 12 #define WEBRTC_P2P_QUIC_RELIABLEQUICSTREAM_H_ |
| 13 |
| 14 #include "net/quic/reliable_quic_stream.h" |
| 15 #include "webrtc/base/constructormagic.h" |
| 16 #include "webrtc/base/sigslot.h" |
| 17 #include "webrtc/base/stream.h" |
| 18 |
| 19 namespace cricket { |
| 20 |
| 21 // Streams created by QuicSession. |
| 22 class ReliableQuicStream : public net::ReliableQuicStream, |
| 23 public sigslot::has_slots<> { |
| 24 public: |
| 25 ReliableQuicStream(net::QuicStreamId id, net::QuicSession* session); |
| 26 |
| 27 ~ReliableQuicStream() override; |
| 28 |
| 29 // ReliableQuicStream overrides. |
| 30 void OnDataAvailable() override; |
| 31 void OnClose() override; |
| 32 net::SpdyPriority Priority() const override { return 0; } |
| 33 |
| 34 // Process decrypted data into encrypted QUIC packets, which get sent to the |
| 35 // QuicPacketWriter. rtc::SR_BLOCK is returned if the operation blocks instead |
| 36 // of writing, in which case the data is queued until OnCanWrite() is called. |
| 37 rtc::StreamResult Write(const char* data, size_t len); |
| 38 |
| 39 // Called when decrypted data is ready to be read. |
| 40 sigslot::signal3<net::QuicStreamId, const char*, size_t> SignalDataReceived; |
| 41 // Called when stream closed. |
| 42 sigslot::signal2<net::QuicStreamId, net::QuicErrorCode> SignalClosed; |
| 43 |
| 44 private: |
| 45 RTC_DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream); |
| 46 }; |
| 47 |
| 48 } // namespace cricket |
| 49 |
| 50 #endif // WEBRTC_P2P_QUIC_RELIABLEQUICSTREAM_H_ |
OLD | NEW |