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

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

Issue 1156623003: Miscellaneous improvements to comments and formatting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Fix_TSAN_problem_93901684
Patch Set: Created 5 years, 7 months 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_data_stream.h ('k') | net/tools/quic/quic_dispatcher.h » ('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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 if (frame.stream_id != id_) { 151 if (frame.stream_id != id_) {
152 session_->connection()->SendConnectionClose(QUIC_INTERNAL_ERROR); 152 session_->connection()->SendConnectionClose(QUIC_INTERNAL_ERROR);
153 return; 153 return;
154 } 154 }
155 155
156 if (frame.fin) { 156 if (frame.fin) {
157 fin_received_ = true; 157 fin_received_ = true;
158 } 158 }
159 159
160 // This count include duplicate data received. 160 // This count includes duplicate data received.
161 size_t frame_payload_size = frame.data.TotalBufferSize(); 161 size_t frame_payload_size = frame.data.TotalBufferSize();
162 stream_bytes_read_ += frame_payload_size; 162 stream_bytes_read_ += frame_payload_size;
163 163
164 // Flow control is interested in tracking highest received offset. 164 // Flow control is interested in tracking highest received offset.
165 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { 165 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) {
166 // As the highest received offset has changed, we should check to see if 166 // As the highest received offset has changed, we should check to see if
167 // this is a violation of flow control. 167 // this is a violation of flow control.
168 if (flow_controller_.FlowControlViolation() || 168 if (flow_controller_.FlowControlViolation() ||
169 connection_flow_controller_->FlowControlViolation()) { 169 connection_flow_controller_->FlowControlViolation()) {
170 session_->connection()->SendConnectionClose( 170 session_->connection()->SendConnectionClose(
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 509 }
510 } 510 }
511 511
512 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { 512 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) {
513 if (flow_controller_.UpdateSendWindowOffset(new_window)) { 513 if (flow_controller_.UpdateSendWindowOffset(new_window)) {
514 OnCanWrite(); 514 OnCanWrite();
515 } 515 }
516 } 516 }
517 517
518 } // namespace net 518 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_data_stream.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698