| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // The base class for streams which deliver data to/from an application. |
| 6 // In each direction, the data on such a stream first contains compressed |
| 7 // headers then body data. |
| 8 |
| 9 #ifndef NET_QUIC_QUIC_MESSAGE_STREAM_H_ |
| 10 #define NET_QUIC_QUIC_MESSAGE_STREAM_H_ |
| 11 |
| 12 #include "net/quic/quic_data_stream.h" |
| 13 |
| 14 namespace net { |
| 15 |
| 16 // TODO(dmz) This should actually be a ReliableQuicStream |
| 17 class NET_EXPORT_PRIVATE QuicMessageStream : public QuicDataStream { |
| 18 public: |
| 19 // Implement this to listen for reads |
| 20 class ReadDelegate { |
| 21 public: |
| 22 virtual ~ReadDelegate() {} |
| 23 |
| 24 virtual void OnStreamRead(QuicStreamId id, |
| 25 const char* data, |
| 26 uint32 data_len) = 0; |
| 27 virtual void OnStreamClose(QuicStreamId) = 0; |
| 28 }; |
| 29 |
| 30 QuicMessageStream(QuicStreamId id, |
| 31 QuicSession* session, |
| 32 ReadDelegate* delegate); |
| 33 |
| 34 virtual ~QuicMessageStream(); |
| 35 |
| 36 int WriteStreamData(base::StringPiece data, bool fin); |
| 37 |
| 38 virtual void OnClose() OVERRIDE; |
| 39 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; |
| 40 |
| 41 private: |
| 42 ReadDelegate* delegate_; // Not owned |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(QuicMessageStream); |
| 45 }; |
| 46 |
| 47 } // namespace net |
| 48 |
| 49 #endif // NET_QUIC_QUIC_MESSAGE_STREAM_H_ |
| OLD | NEW |