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_ack_listener_interface.h" | 9 #include "net/quic/quic_ack_listener_interface.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (!stream_contributes_to_connection_flow_control_) { | 270 if (!stream_contributes_to_connection_flow_control_) { |
271 return; | 271 return; |
272 } | 272 } |
273 connection_flow_controller_->MaybeSendBlocked(); | 273 connection_flow_controller_->MaybeSendBlocked(); |
274 // If the stream is blocked by connection-level flow control but not by | 274 // If the stream is blocked by connection-level flow control but not by |
275 // stream-level flow control, add the stream to the write blocked list so that | 275 // stream-level flow control, add the stream to the write blocked list so that |
276 // the stream will be given a chance to write when a connection-level | 276 // the stream will be given a chance to write when a connection-level |
277 // WINDOW_UPDATE arrives. | 277 // WINDOW_UPDATE arrives. |
278 if (connection_flow_controller_->IsBlocked() && | 278 if (connection_flow_controller_->IsBlocked() && |
279 !flow_controller_.IsBlocked()) { | 279 !flow_controller_.IsBlocked()) { |
280 session_->MarkConnectionLevelWriteBlocked(id(), EffectivePriority()); | 280 session_->MarkConnectionLevelWriteBlocked(id(), Priority()); |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 QuicConsumedData ReliableQuicStream::WritevData( | 284 QuicConsumedData ReliableQuicStream::WritevData( |
285 const struct iovec* iov, | 285 const struct iovec* iov, |
286 int iov_count, | 286 int iov_count, |
287 bool fin, | 287 bool fin, |
288 QuicAckListenerInterface* ack_listener) { | 288 QuicAckListenerInterface* ack_listener) { |
289 if (write_side_closed_) { | 289 if (write_side_closed_) { |
290 DLOG(ERROR) << ENDPOINT << "Attempt to write when the write side is closed"; | 290 DLOG(ERROR) << ENDPOINT << "Attempt to write when the write side is closed"; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 if (!fin_with_zero_data) { | 335 if (!fin_with_zero_data) { |
336 MaybeSendBlocked(); | 336 MaybeSendBlocked(); |
337 } | 337 } |
338 if (fin && consumed_data.fin_consumed) { | 338 if (fin && consumed_data.fin_consumed) { |
339 fin_sent_ = true; | 339 fin_sent_ = true; |
340 if (fin_received_) { | 340 if (fin_received_) { |
341 session_->StreamDraining(id_); | 341 session_->StreamDraining(id_); |
342 } | 342 } |
343 CloseWriteSide(); | 343 CloseWriteSide(); |
344 } else if (fin && !consumed_data.fin_consumed) { | 344 } else if (fin && !consumed_data.fin_consumed) { |
345 session_->MarkConnectionLevelWriteBlocked(id(), EffectivePriority()); | 345 session_->MarkConnectionLevelWriteBlocked(id(), Priority()); |
346 } | 346 } |
347 } else { | 347 } else { |
348 session_->MarkConnectionLevelWriteBlocked(id(), EffectivePriority()); | 348 session_->MarkConnectionLevelWriteBlocked(id(), Priority()); |
349 } | 349 } |
350 return consumed_data; | 350 return consumed_data; |
351 } | 351 } |
352 | 352 |
353 FecProtection ReliableQuicStream::GetFecProtection() { | 353 FecProtection ReliableQuicStream::GetFecProtection() { |
354 return fec_policy_ == FEC_PROTECT_ALWAYS ? MUST_FEC_PROTECT : MAY_FEC_PROTECT; | 354 return fec_policy_ == FEC_PROTECT_ALWAYS ? MUST_FEC_PROTECT : MAY_FEC_PROTECT; |
355 } | 355 } |
356 | 356 |
357 void ReliableQuicStream::CloseReadSide() { | 357 void ReliableQuicStream::CloseReadSide() { |
358 if (read_side_closed_) { | 358 if (read_side_closed_) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 } | 471 } |
472 | 472 |
473 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 473 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
474 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 474 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
475 OnCanWrite(); | 475 OnCanWrite(); |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 } // namespace net | 479 } // namespace net |
OLD | NEW |