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/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_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 return false; | 708 return false; |
709 } | 709 } |
710 if (id % 2 == next_stream_id_ % 2) { | 710 if (id % 2 == next_stream_id_ % 2) { |
711 // Locally created streams are strictly in-order. If the id is in the | 711 // Locally created streams are strictly in-order. If the id is in the |
712 // range of created streams and it's not active, it must have been closed. | 712 // range of created streams and it's not active, it must have been closed. |
713 return id < next_stream_id_; | 713 return id < next_stream_id_; |
714 } | 714 } |
715 // For peer created streams, we also need to consider implicitly created | 715 // For peer created streams, we also need to consider implicitly created |
716 // streams. | 716 // streams. |
717 return id <= largest_peer_created_stream_id_ && | 717 return id <= largest_peer_created_stream_id_ && |
718 implicitly_created_streams_.count(id) == 0; | 718 !ContainsKey(implicitly_created_streams_, id); |
719 } | 719 } |
720 | 720 |
721 size_t QuicSession::GetNumOpenStreams() const { | 721 size_t QuicSession::GetNumOpenStreams() const { |
722 return stream_map_.size() + implicitly_created_streams_.size(); | 722 return stream_map_.size() + implicitly_created_streams_.size(); |
723 } | 723 } |
724 | 724 |
725 void QuicSession::MarkWriteBlocked(QuicStreamId id, QuicPriority priority) { | 725 void QuicSession::MarkWriteBlocked(QuicStreamId id, QuicPriority priority) { |
726 #ifndef NDEBUG | 726 #ifndef NDEBUG |
727 ReliableQuicStream* stream = GetStream(id); | 727 ReliableQuicStream* stream = GetStream(id); |
728 if (stream != nullptr) { | 728 if (stream != nullptr) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 for (DataStreamMap::iterator it = stream_map_.begin(); | 790 for (DataStreamMap::iterator it = stream_map_.begin(); |
791 it != stream_map_.end(); ++it) { | 791 it != stream_map_.end(); ++it) { |
792 if (it->second->flow_controller()->IsBlocked()) { | 792 if (it->second->flow_controller()->IsBlocked()) { |
793 return true; | 793 return true; |
794 } | 794 } |
795 } | 795 } |
796 return false; | 796 return false; |
797 } | 797 } |
798 | 798 |
799 } // namespace net | 799 } // namespace net |
OLD | NEW |