OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NOTE: This code is not shared between Google and Chrome. | 5 // NOTE: This code is not shared between Google and Chrome. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 7 #ifndef NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
8 #define NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 8 #define NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
9 | 9 |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual void OnError(int error) = 0; | 49 virtual void OnError(int error) = 0; |
50 | 50 |
51 protected: | 51 protected: |
52 virtual ~Delegate() {} | 52 virtual ~Delegate() {} |
53 | 53 |
54 private: | 54 private: |
55 DISALLOW_COPY_AND_ASSIGN(Delegate); | 55 DISALLOW_COPY_AND_ASSIGN(Delegate); |
56 }; | 56 }; |
57 | 57 |
58 QuicReliableClientStream(QuicStreamId id, | 58 QuicReliableClientStream(QuicStreamId id, |
59 QuicSession* session, | 59 QuicSession* session); |
60 const BoundNetLog& net_log); | |
61 | 60 |
62 virtual ~QuicReliableClientStream(); | 61 virtual ~QuicReliableClientStream(); |
63 | 62 |
64 // ReliableQuicStream | 63 // ReliableQuicStream |
65 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; | 64 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; |
66 virtual void TerminateFromPeer(bool half_close) OVERRIDE; | 65 virtual void TerminateFromPeer(bool half_close) OVERRIDE; |
67 using ReliableQuicStream::WriteData; | 66 using ReliableQuicStream::WriteData; |
68 | 67 |
69 // Set new |delegate|. |delegate| must not be NULL. | 68 // Set new |delegate|. |delegate| must not be NULL. |
70 // If this stream has already received data, OnDataReceived() will be | 69 // If this stream has already received data, OnDataReceived() will be |
71 // called on the delegate. | 70 // called on the delegate. |
72 void SetDelegate(Delegate* delegate); | 71 void SetDelegate(Delegate* delegate); |
73 Delegate* GetDelegate() { return delegate_; } | 72 Delegate* GetDelegate() { return delegate_; } |
74 void OnError(int error); | 73 void OnError(int error); |
75 | 74 |
76 const BoundNetLog& net_log() const { return net_log_; } | |
77 | |
78 private: | 75 private: |
79 BoundNetLog net_log_; | |
80 Delegate* delegate_; | 76 Delegate* delegate_; |
81 | 77 |
82 DISALLOW_COPY_AND_ASSIGN(QuicReliableClientStream); | 78 DISALLOW_COPY_AND_ASSIGN(QuicReliableClientStream); |
83 }; | 79 }; |
84 | 80 |
85 } // namespace net | 81 } // namespace net |
86 | 82 |
87 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 83 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
OLD | NEW |