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 10 matching lines...) Expand all Loading... |
21 // A client-initiated ReliableQuicStream. Instances of this class | 21 // A client-initiated ReliableQuicStream. Instances of this class |
22 // are owned by the QuicClientSession which created them. | 22 // are owned by the QuicClientSession which created them. |
23 class NET_EXPORT_PRIVATE QuicReliableClientStream : public QuicDataStream { | 23 class NET_EXPORT_PRIVATE QuicReliableClientStream : public QuicDataStream { |
24 public: | 24 public: |
25 // Delegate handles protocol specific behavior of a quic stream. | 25 // Delegate handles protocol specific behavior of a quic stream. |
26 class NET_EXPORT_PRIVATE Delegate { | 26 class NET_EXPORT_PRIVATE Delegate { |
27 public: | 27 public: |
28 Delegate() {} | 28 Delegate() {} |
29 | 29 |
30 // Called when headers are available. | 30 // Called when headers are available. |
31 virtual void OnHeadersAvailable(const SpdyHeaderBlock& headers) = 0; | 31 virtual void OnHeadersAvailable(const SpdyHeaderBlock& headers, |
| 32 size_t frame_len) = 0; |
32 | 33 |
33 // Called when data is available to be read. | 34 // Called when data is available to be read. |
34 virtual void OnDataAvailable() = 0; | 35 virtual void OnDataAvailable() = 0; |
35 | 36 |
36 // Called when the stream is closed by the peer. | 37 // Called when the stream is closed by the peer. |
37 virtual void OnClose(QuicErrorCode error) = 0; | 38 virtual void OnClose(QuicErrorCode error) = 0; |
38 | 39 |
39 // Called when the stream is closed because of an error. | 40 // Called when the stream is closed because of an error. |
40 virtual void OnError(int error) = 0; | 41 virtual void OnError(int error) = 0; |
41 | 42 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // turn out to be write blocked, of course). If the stream can not write, | 84 // turn out to be write blocked, of course). If the stream can not write, |
84 // this method returns false, and |callback| will be invoked when | 85 // this method returns false, and |callback| will be invoked when |
85 // it becomes writable. | 86 // it becomes writable. |
86 bool CanWrite(const CompletionCallback& callback); | 87 bool CanWrite(const CompletionCallback& callback); |
87 | 88 |
88 const BoundNetLog& net_log() const { return net_log_; } | 89 const BoundNetLog& net_log() const { return net_log_; } |
89 | 90 |
90 using QuicDataStream::HasBufferedData; | 91 using QuicDataStream::HasBufferedData; |
91 | 92 |
92 private: | 93 private: |
93 void NotifyDelegateOfHeadersCompleteLater(); | 94 void NotifyDelegateOfHeadersCompleteLater(size_t frame_len); |
94 void NotifyDelegateOfHeadersComplete(); | 95 void NotifyDelegateOfHeadersComplete(size_t frame_len); |
95 void NotifyDelegateOfDataAvailableLater(); | 96 void NotifyDelegateOfDataAvailableLater(); |
96 void NotifyDelegateOfDataAvailable(); | 97 void NotifyDelegateOfDataAvailable(); |
97 | 98 |
98 BoundNetLog net_log_; | 99 BoundNetLog net_log_; |
99 Delegate* delegate_; | 100 Delegate* delegate_; |
100 | 101 |
101 bool headers_delivered_; | 102 bool headers_delivered_; |
102 | 103 |
103 CompletionCallback callback_; | 104 CompletionCallback callback_; |
104 | 105 |
105 base::WeakPtrFactory<QuicReliableClientStream> weak_factory_; | 106 base::WeakPtrFactory<QuicReliableClientStream> weak_factory_; |
106 | 107 |
107 DISALLOW_COPY_AND_ASSIGN(QuicReliableClientStream); | 108 DISALLOW_COPY_AND_ASSIGN(QuicReliableClientStream); |
108 }; | 109 }; |
109 | 110 |
110 } // namespace net | 111 } // namespace net |
111 | 112 |
112 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ | 113 #endif // NET_QUIC_QUIC_RELIABLE_CLIENT_STREAM_H_ |
OLD | NEW |