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 #include "net/quic/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
6 | 6 |
7 #include "net/quic/quic_session.h" | 7 #include "net/quic/quic_session.h" |
8 #include "net/quic/quic_spdy_decompressor.h" | 8 #include "net/quic/quic_spdy_decompressor.h" |
9 #include "net/spdy/write_blocked_list.h" | 9 #include "net/spdy/write_blocked_list.h" |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { | 106 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { |
107 session()->connection()->SendConnectionClose(error); | 107 session()->connection()->SendConnectionClose(error); |
108 } | 108 } |
109 | 109 |
110 void ReliableQuicStream::CloseConnectionWithDetails(QuicErrorCode error, | 110 void ReliableQuicStream::CloseConnectionWithDetails(QuicErrorCode error, |
111 const string& details) { | 111 const string& details) { |
112 session()->connection()->SendConnectionCloseWithDetails(error, details); | 112 session()->connection()->SendConnectionCloseWithDetails(error, details); |
113 } | 113 } |
114 | 114 |
| 115 QuicVersion ReliableQuicStream::version() { |
| 116 return session()->connection()->version(); |
| 117 } |
| 118 |
115 void ReliableQuicStream::WriteOrBufferData(StringPiece data, bool fin) { | 119 void ReliableQuicStream::WriteOrBufferData(StringPiece data, bool fin) { |
116 DCHECK(data.size() > 0 || fin); | 120 DCHECK(data.size() > 0 || fin); |
117 DCHECK(!fin_buffered_); | 121 DCHECK(!fin_buffered_); |
118 | 122 |
119 QuicConsumedData consumed_data(0, false); | 123 QuicConsumedData consumed_data(0, false); |
120 fin_buffered_ = fin; | 124 fin_buffered_ = fin; |
121 | 125 |
122 if (queued_data_.empty()) { | 126 if (queued_data_.empty()) { |
123 struct iovec iov(MakeIovec(data)); | 127 struct iovec iov(MakeIovec(data)); |
124 consumed_data = WritevData(&iov, 1, fin, NULL); | 128 consumed_data = WritevData(&iov, 1, fin, NULL); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool ReliableQuicStream::HasBufferedData() { | 216 bool ReliableQuicStream::HasBufferedData() { |
213 return !queued_data_.empty(); | 217 return !queued_data_.empty(); |
214 } | 218 } |
215 | 219 |
216 void ReliableQuicStream::OnClose() { | 220 void ReliableQuicStream::OnClose() { |
217 CloseReadSide(); | 221 CloseReadSide(); |
218 CloseWriteSide(); | 222 CloseWriteSide(); |
219 } | 223 } |
220 | 224 |
221 } // namespace net | 225 } // namespace net |
OLD | NEW |