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

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

Issue 1744103003: QuicSession::CreateIncomingDynamicStream now retains ownership of the created stream. No functional… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_session.h ('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 "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/quic/crypto/proof_verifier.h" 10 #include "net/quic/crypto/proof_verifier.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 if (connection()->version() <= QUIC_VERSION_27) { 684 if (connection()->version() <= QUIC_VERSION_27) {
685 connection()->SendConnectionCloseWithDetails( 685 connection()->SendConnectionCloseWithDetails(
686 QUIC_TOO_MANY_OPEN_STREAMS, "Old style stream rejection"); 686 QUIC_TOO_MANY_OPEN_STREAMS, "Old style stream rejection");
687 } else { 687 } else {
688 // Refuse to open the stream. 688 // Refuse to open the stream.
689 SendRstStream(stream_id, QUIC_REFUSED_STREAM, 0); 689 SendRstStream(stream_id, QUIC_REFUSED_STREAM, 0);
690 } 690 }
691 return nullptr; 691 return nullptr;
692 } 692 }
693 693
694 ReliableQuicStream* stream = CreateIncomingDynamicStream(stream_id); 694 return CreateIncomingDynamicStream(stream_id);
695 if (stream == nullptr) {
696 return nullptr;
697 }
698 ActivateStream(stream);
699 return stream;
700 } 695 }
701 696
702 void QuicSession::set_max_open_incoming_streams( 697 void QuicSession::set_max_open_incoming_streams(
703 size_t max_open_incoming_streams) { 698 size_t max_open_incoming_streams) {
704 DVLOG(1) << "Setting max_open_incoming_streams_ to " 699 DVLOG(1) << "Setting max_open_incoming_streams_ to "
705 << max_open_incoming_streams; 700 << max_open_incoming_streams;
706 max_open_incoming_streams_ = max_open_incoming_streams; 701 max_open_incoming_streams_ = max_open_incoming_streams;
707 DVLOG(1) << "MaxAvailableStreams() became " << MaxAvailableStreams(); 702 DVLOG(1) << "MaxAvailableStreams() became " << MaxAvailableStreams();
708 } 703 }
709 704
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 812
818 size_t QuicSession::MaxAvailableStreams() const { 813 size_t QuicSession::MaxAvailableStreams() const {
819 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; 814 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier;
820 } 815 }
821 816
822 bool QuicSession::IsIncomingStream(QuicStreamId id) const { 817 bool QuicSession::IsIncomingStream(QuicStreamId id) const {
823 return id % 2 != next_outgoing_stream_id_ % 2; 818 return id % 2 != next_outgoing_stream_id_ % 2;
824 } 819 }
825 820
826 } // namespace net 821 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698