| 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_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 7 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| 8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 8 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // A client-initiated ReliableQuicStream. Instances of this class | 31 // A client-initiated ReliableQuicStream. Instances of this class |
| 32 // are owned by the QuicClientSession which created them. | 32 // are owned by the QuicClientSession which created them. |
| 33 class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { | 33 class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { |
| 34 public: | 34 public: |
| 35 // Delegate handles protocol specific behavior of a quic stream. | 35 // Delegate handles protocol specific behavior of a quic stream. |
| 36 class NET_EXPORT_PRIVATE Delegate { | 36 class NET_EXPORT_PRIVATE Delegate { |
| 37 public: | 37 public: |
| 38 Delegate() {} | 38 Delegate() {} |
| 39 | 39 |
| 40 // Called when headers are available. | 40 // Called when initial headers are available. |
| 41 virtual void OnHeadersAvailable(const SpdyHeaderBlock& headers, | 41 virtual void OnInitialHeadersAvailable(const SpdyHeaderBlock& headers, |
| 42 size_t frame_len) = 0; | 42 size_t frame_len) = 0; |
| 43 |
| 44 // Called when trailing headers are available. |
| 45 virtual void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, |
| 46 size_t frame_len) = 0; |
| 43 | 47 |
| 44 // Called when data is available to be read. | 48 // Called when data is available to be read. |
| 45 virtual void OnDataAvailable() = 0; | 49 virtual void OnDataAvailable() = 0; |
| 46 | 50 |
| 47 // Called when the stream is closed by the peer. | 51 // Called when the stream is closed by the peer. |
| 48 virtual void OnClose() = 0; | 52 virtual void OnClose() = 0; |
| 49 | 53 |
| 50 // Called when the stream is closed because of an error. | 54 // Called when the stream is closed because of an error. |
| 51 virtual void OnError(int error) = 0; | 55 virtual void OnError(int error) = 0; |
| 52 | 56 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 117 |
| 114 bool can_migrate() { return can_migrate_; } | 118 bool can_migrate() { return can_migrate_; } |
| 115 | 119 |
| 116 // True if this stream is the first data stream created on this session. | 120 // True if this stream is the first data stream created on this session. |
| 117 bool IsFirstStream(); | 121 bool IsFirstStream(); |
| 118 | 122 |
| 119 using QuicSpdyStream::HasBufferedData; | 123 using QuicSpdyStream::HasBufferedData; |
| 120 using QuicStream::sequencer; | 124 using QuicStream::sequencer; |
| 121 | 125 |
| 122 private: | 126 private: |
| 123 void NotifyDelegateOfHeadersCompleteLater(SpdyHeaderBlock headers, | 127 void NotifyDelegateOfInitialHeadersAvailableLater(SpdyHeaderBlock headers, |
| 124 size_t frame_len); | 128 size_t frame_len); |
| 125 void NotifyDelegateOfHeadersComplete(SpdyHeaderBlock headers, | 129 void NotifyDelegateOfInitialHeadersAvailable(SpdyHeaderBlock headers, |
| 126 size_t frame_len); | 130 size_t frame_len); |
| 131 void NotifyDelegateOfTrailingHeadersAvailableLater(SpdyHeaderBlock headers, |
| 132 size_t frame_len); |
| 133 void NotifyDelegateOfTrailingHeadersAvailable(SpdyHeaderBlock headers, |
| 134 size_t frame_len); |
| 127 void NotifyDelegateOfDataAvailableLater(); | 135 void NotifyDelegateOfDataAvailableLater(); |
| 128 void NotifyDelegateOfDataAvailable(); | 136 void NotifyDelegateOfDataAvailable(); |
| 129 | 137 |
| 130 NetLogWithSource net_log_; | 138 NetLogWithSource net_log_; |
| 131 Delegate* delegate_; | 139 Delegate* delegate_; |
| 132 | 140 |
| 133 bool headers_delivered_; | 141 bool headers_delivered_; |
| 134 | 142 |
| 135 // True when initial headers have been sent. | 143 // True when initial headers have been sent. |
| 136 bool initial_headers_sent_; | 144 bool initial_headers_sent_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 150 size_t initial_headers_frame_len_; | 158 size_t initial_headers_frame_len_; |
| 151 | 159 |
| 152 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; | 160 base::WeakPtrFactory<QuicChromiumClientStream> weak_factory_; |
| 153 | 161 |
| 154 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); | 162 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientStream); |
| 155 }; | 163 }; |
| 156 | 164 |
| 157 } // namespace net | 165 } // namespace net |
| 158 | 166 |
| 159 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ | 167 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_CLIENT_STREAM_H_ |
| OLD | NEW |