| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // Locally created streams are strictly in-order. If the id is in the | 260 // Locally created streams are strictly in-order. If the id is in the |
| 261 // range of created streams and it's not active, it must have been closed. | 261 // range of created streams and it's not active, it must have been closed. |
| 262 return id < next_stream_id_; | 262 return id < next_stream_id_; |
| 263 } | 263 } |
| 264 // For peer created streams, we also need to consider implicitly created | 264 // For peer created streams, we also need to consider implicitly created |
| 265 // streams. | 265 // streams. |
| 266 return id <= largest_peer_created_stream_id_ && | 266 return id <= largest_peer_created_stream_id_ && |
| 267 implicitly_created_streams_.count(id) == 0; | 267 implicitly_created_streams_.count(id) == 0; |
| 268 } | 268 } |
| 269 | 269 |
| 270 size_t QuicSession::GetNumOpenStreams() { | 270 size_t QuicSession::GetNumOpenStreams() const { |
| 271 return stream_map_.size() + implicitly_created_streams_.size(); | 271 return stream_map_.size() + implicitly_created_streams_.size(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void QuicSession::MarkWriteBlocked(QuicStreamId id) { | 274 void QuicSession::MarkWriteBlocked(QuicStreamId id) { |
| 275 write_blocked_streams_.push_back(id); | 275 write_blocked_streams_.push_back(id); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void QuicSession::PostProcessAfterData() { | 278 void QuicSession::PostProcessAfterData() { |
| 279 STLDeleteElements(&closed_streams_); | 279 STLDeleteElements(&closed_streams_); |
| 280 closed_streams_.clear(); | 280 closed_streams_.clear(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace net | 283 } // namespace net |
| OLD | NEW |