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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/iovector.h" | 8 #include "net/quic/iovector.h" |
9 #include "net/quic/quic_flow_controller.h" | 9 #include "net/quic/quic_flow_controller.h" |
10 #include "net/quic/quic_session.h" | 10 #include "net/quic/quic_session.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Accumulators. | 121 // Accumulators. |
122 int num_original_packets_; | 122 int num_original_packets_; |
123 int num_original_bytes_; | 123 int num_original_bytes_; |
124 int num_retransmitted_packets_; | 124 int num_retransmitted_packets_; |
125 int num_retransmitted_bytes_; | 125 int num_retransmitted_bytes_; |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(ProxyAckNotifierDelegate); | 127 DISALLOW_COPY_AND_ASSIGN(ProxyAckNotifierDelegate); |
128 }; | 128 }; |
129 | 129 |
130 ReliableQuicStream::PendingData::PendingData( | 130 ReliableQuicStream::PendingData::PendingData( |
131 string data_in, scoped_refptr<ProxyAckNotifierDelegate> delegate_in) | 131 std::string data_in, scoped_refptr<ProxyAckNotifierDelegate> delegate_in) |
132 : data(data_in), delegate(delegate_in) { | 132 : data(data_in), delegate(delegate_in) { |
133 } | 133 } |
134 | 134 |
135 ReliableQuicStream::PendingData::~PendingData() { | 135 ReliableQuicStream::PendingData::~PendingData() { |
136 } | 136 } |
137 | 137 |
138 ReliableQuicStream::ReliableQuicStream(QuicStreamId id, QuicSession* session) | 138 ReliableQuicStream::ReliableQuicStream(QuicStreamId id, QuicSession* session) |
139 : sequencer_(this), | 139 : sequencer_(this), |
140 id_(id), | 140 id_(id), |
141 session_(session), | 141 session_(session), |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 stream_error_ = error; | 241 stream_error_ = error; |
242 // Sending a RstStream results in calling CloseStream. | 242 // Sending a RstStream results in calling CloseStream. |
243 session()->SendRstStream(id(), error, stream_bytes_written_); | 243 session()->SendRstStream(id(), error, stream_bytes_written_); |
244 rst_sent_ = true; | 244 rst_sent_ = true; |
245 } | 245 } |
246 | 246 |
247 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { | 247 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { |
248 session()->connection()->SendConnectionClose(error); | 248 session()->connection()->SendConnectionClose(error); |
249 } | 249 } |
250 | 250 |
251 void ReliableQuicStream::CloseConnectionWithDetails(QuicErrorCode error, | 251 void ReliableQuicStream::CloseConnectionWithDetails( |
252 const string& details) { | 252 QuicErrorCode error, const std::string& details) { |
253 session()->connection()->SendConnectionCloseWithDetails(error, details); | 253 session()->connection()->SendConnectionCloseWithDetails(error, details); |
254 } | 254 } |
255 | 255 |
256 QuicVersion ReliableQuicStream::version() const { | 256 QuicVersion ReliableQuicStream::version() const { |
257 return session()->connection()->version(); | 257 return session()->connection()->version(); |
258 } | 258 } |
259 | 259 |
260 void ReliableQuicStream::WriteOrBufferData( | 260 void ReliableQuicStream::WriteOrBufferData( |
261 StringPiece data, | 261 StringPiece data, |
262 bool fin, | 262 bool fin, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 538 |
539 bool ReliableQuicStream::IsFlowControlBlocked() { | 539 bool ReliableQuicStream::IsFlowControlBlocked() { |
540 if (flow_controller_.IsBlocked()) { | 540 if (flow_controller_.IsBlocked()) { |
541 return true; | 541 return true; |
542 } | 542 } |
543 return stream_contributes_to_connection_flow_control_ && | 543 return stream_contributes_to_connection_flow_control_ && |
544 connection_flow_controller_->IsBlocked(); | 544 connection_flow_controller_->IsBlocked(); |
545 } | 545 } |
546 | 546 |
547 } // namespace net | 547 } // namespace net |
OLD | NEW |