| 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/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/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // TODO(alyssar) check against existing connection address: if changed, make | 101 // TODO(alyssar) check against existing connection address: if changed, make |
| 102 // sure we update the connection. | 102 // sure we update the connection. |
| 103 } | 103 } |
| 104 | 104 |
| 105 for (size_t i = 0; i < frames.size(); ++i) { | 105 for (size_t i = 0; i < frames.size(); ++i) { |
| 106 ReliableQuicStream* stream = GetStream(frames[i].stream_id); | 106 ReliableQuicStream* stream = GetStream(frames[i].stream_id); |
| 107 if (stream) { | 107 if (stream) { |
| 108 stream->OnStreamFrame(frames[i]); | 108 stream->OnStreamFrame(frames[i]); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 |
| 112 while (!decompression_blocked_streams_.empty()) { |
| 113 QuicHeaderId header_id = decompression_blocked_streams_.begin()->first; |
| 114 if (header_id == decompressor_.current_header_id()) { |
| 115 QuicStreamId stream_id = decompression_blocked_streams_.begin()->second; |
| 116 decompression_blocked_streams_.erase(header_id); |
| 117 ReliableQuicStream* stream = GetStream(stream_id); |
| 118 if (!stream) { |
| 119 connection()->SendConnectionClose( |
| 120 QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED); |
| 121 } |
| 122 stream->OnDecompressorAvailable(); |
| 123 } |
| 124 } |
| 111 return true; | 125 return true; |
| 112 } | 126 } |
| 113 | 127 |
| 114 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { | 128 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { |
| 115 ReliableQuicStream* stream = GetStream(frame.stream_id); | 129 ReliableQuicStream* stream = GetStream(frame.stream_id); |
| 116 if (!stream) { | 130 if (!stream) { |
| 117 return; // Errors are handled by GetStream. | 131 return; // Errors are handled by GetStream. |
| 118 } | 132 } |
| 119 stream->OnStreamReset(frame.error_code); | 133 stream->OnStreamReset(frame.error_code); |
| 120 } | 134 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 309 } |
| 296 | 310 |
| 297 size_t QuicSession::GetNumOpenStreams() const { | 311 size_t QuicSession::GetNumOpenStreams() const { |
| 298 return stream_map_.size() + implicitly_created_streams_.size(); | 312 return stream_map_.size() + implicitly_created_streams_.size(); |
| 299 } | 313 } |
| 300 | 314 |
| 301 void QuicSession::MarkWriteBlocked(QuicStreamId id) { | 315 void QuicSession::MarkWriteBlocked(QuicStreamId id) { |
| 302 write_blocked_streams_.AddBlockedObject(id); | 316 write_blocked_streams_.AddBlockedObject(id); |
| 303 } | 317 } |
| 304 | 318 |
| 319 void QuicSession::MarkDecompressionBlocked(QuicHeaderId header_id, |
| 320 QuicStreamId stream_id) { |
| 321 decompression_blocked_streams_[header_id] = stream_id; |
| 322 } |
| 323 |
| 305 void QuicSession::PostProcessAfterData() { | 324 void QuicSession::PostProcessAfterData() { |
| 306 STLDeleteElements(&closed_streams_); | 325 STLDeleteElements(&closed_streams_); |
| 307 closed_streams_.clear(); | 326 closed_streams_.clear(); |
| 308 } | 327 } |
| 309 | 328 |
| 310 } // namespace net | 329 } // namespace net |
| OLD | NEW |