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

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

Issue 1138443003: Land Recent QUIC Changes until 05/13/2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile error fixes 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_sent_packet_manager_test.cc ('k') | net/quic/quic_utils_test.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/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/proof_verifier.h" 8 #include "net/quic/crypto/proof_verifier.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flow_controller.h" 10 #include "net/quic/quic_flow_controller.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 STLDeleteElements(&closed_streams_); 127 STLDeleteElements(&closed_streams_);
128 STLDeleteValues(&stream_map_); 128 STLDeleteValues(&stream_map_);
129 129
130 DLOG_IF(WARNING, 130 DLOG_IF(WARNING,
131 locally_closed_streams_highest_offset_.size() > max_open_streams_) 131 locally_closed_streams_highest_offset_.size() > max_open_streams_)
132 << "Surprisingly high number of locally closed streams still waiting for " 132 << "Surprisingly high number of locally closed streams still waiting for "
133 "final byte offset: " << locally_closed_streams_highest_offset_.size(); 133 "final byte offset: " << locally_closed_streams_highest_offset_.size();
134 } 134 }
135 135
136 void QuicSession::OnStreamFrames(const vector<QuicStreamFrame>& frames) { 136 void QuicSession::OnStreamFrames(const vector<QuicStreamFrame>& frames) {
137 for (size_t i = 0; i < frames.size(); ++i) { 137 for (size_t i = 0; i < frames.size() && connection_->connected(); ++i) {
138 // TODO(rch) deal with the error case of stream id 0. 138 // TODO(rch) deal with the error case of stream id 0.
139 const QuicStreamFrame& frame = frames[i]; 139 const QuicStreamFrame& frame = frames[i];
140 QuicStreamId stream_id = frame.stream_id; 140 QuicStreamId stream_id = frame.stream_id;
141 ReliableQuicStream* stream = GetStream(stream_id); 141 ReliableQuicStream* stream = GetStream(stream_id);
142 if (!stream) { 142 if (!stream) {
143 // The stream no longer exists, but we may still be interested in the 143 // The stream no longer exists, but we may still be interested in the
144 // final stream byte offset sent by the peer. A frame with a FIN can give 144 // final stream byte offset sent by the peer. A frame with a FIN can give
145 // us this offset. 145 // us this offset.
146 if (frame.fin) { 146 if (frame.fin) {
147 QuicStreamOffset final_byte_offset = 147 QuicStreamOffset final_byte_offset =
148 frame.offset + frame.data.TotalBufferSize(); 148 frame.offset + frame.data.TotalBufferSize();
149 UpdateFlowControlOnFinalReceivedByteOffset(stream_id, 149 UpdateFlowControlOnFinalReceivedByteOffset(stream_id,
150 final_byte_offset); 150 final_byte_offset);
151 } 151 }
152 152
153 continue; 153 continue;
154 } 154 }
155 stream->OnStreamFrame(frames[i]); 155 stream->OnStreamFrame(frames[i]);
156 if (!connection_->connected()) {
157 return;
158 }
156 } 159 }
157 } 160 }
158 161
159 void QuicSession::OnStreamHeaders(QuicStreamId stream_id, 162 void QuicSession::OnStreamHeaders(QuicStreamId stream_id,
160 StringPiece headers_data) { 163 StringPiece headers_data) {
161 QuicDataStream* stream = GetDataStream(stream_id); 164 QuicDataStream* stream = GetDataStream(stream_id);
162 if (!stream) { 165 if (!stream) {
163 // It's quite possible to receive headers after a stream has been reset. 166 // It's quite possible to receive headers after a stream has been reset.
164 return; 167 return;
165 } 168 }
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 for (DataStreamMap::iterator it = stream_map_.begin(); 740 for (DataStreamMap::iterator it = stream_map_.begin();
738 it != stream_map_.end(); ++it) { 741 it != stream_map_.end(); ++it) {
739 if (it->second->flow_controller()->IsBlocked()) { 742 if (it->second->flow_controller()->IsBlocked()) {
740 return true; 743 return true;
741 } 744 }
742 } 745 }
743 return false; 746 return false;
744 } 747 }
745 748
746 } // namespace net 749 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698