Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: net/quic/reliable_quic_stream.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_utils.cc ('k') | net/quic/test_tools/quic_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 void ReliableQuicStream::OnClose() { 451 void ReliableQuicStream::OnClose() {
452 CloseReadSide(); 452 CloseReadSide();
453 CloseWriteSide(); 453 CloseWriteSide();
454 454
455 if (!fin_sent_ && !rst_sent_) { 455 if (!fin_sent_ && !rst_sent_) {
456 // For flow control accounting, we must tell the peer how many bytes we have 456 // For flow control accounting, we must tell the peer how many bytes we have
457 // written on this stream before termination. Done here if needed, using a 457 // written on this stream before termination. Done here if needed, using a
458 // RST frame. 458 // RST frame.
459 DVLOG(1) << ENDPOINT << "Sending RST in OnClose: " << id(); 459 DVLOG(1) << ENDPOINT << "Sending RST in OnClose: " << id();
460 session_->SendRstStream(id(), QUIC_RST_FLOW_CONTROL_ACCOUNTING, 460 session_->SendRstStream(id(), QUIC_RST_ACKNOWLEDGEMENT,
461 stream_bytes_written_); 461 stream_bytes_written_);
462 rst_sent_ = true; 462 rst_sent_ = true;
463 } 463 }
464 464
465 // We are closing the stream and will not process any further incoming bytes. 465 // We are closing the stream and will not process any further incoming bytes.
466 // As there may be more bytes in flight and we need to ensure that both 466 // As there may be more bytes in flight and we need to ensure that both
467 // endpoints have the same connection level flow control state, mark all 467 // endpoints have the same connection level flow control state, mark all
468 // unreceived or buffered bytes as consumed. 468 // unreceived or buffered bytes as consumed.
469 uint64 bytes_to_consume = flow_controller_.highest_received_byte_offset() - 469 uint64 bytes_to_consume = flow_controller_.highest_received_byte_offset() -
470 flow_controller_.bytes_consumed(); 470 flow_controller_.bytes_consumed();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « net/quic/quic_utils.cc ('k') | net/quic/test_tools/quic_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698