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

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

Issue 665823004: Replace calls to set.count() with ContainsKey in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Allow_QUIC_BBR_TCP_sender_to_pace_77668996
Patch Set: Created 6 years, 2 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_fec_group.cc ('k') | net/quic/quic_session_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_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_fec_group.cc ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698