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

Side by Side Diff: net/quic/quic_session_test.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.cc ('k') | net/tools/quic/quic_client_session.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 <set> 7 #include <set>
8 8
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return stream; 129 return stream;
130 } 130 }
131 131
132 TestStream* CreateIncomingDynamicStream(QuicStreamId id) override { 132 TestStream* CreateIncomingDynamicStream(QuicStreamId id) override {
133 // Enforce the limit on the number of open streams. 133 // Enforce the limit on the number of open streams.
134 if (GetNumOpenIncomingStreams() + 1 > max_open_incoming_streams()) { 134 if (GetNumOpenIncomingStreams() + 1 > max_open_incoming_streams()) {
135 connection()->SendConnectionCloseWithDetails(QUIC_TOO_MANY_OPEN_STREAMS, 135 connection()->SendConnectionCloseWithDetails(QUIC_TOO_MANY_OPEN_STREAMS,
136 "Too many streams!"); 136 "Too many streams!");
137 return nullptr; 137 return nullptr;
138 } else { 138 } else {
139 return new TestStream(id, this); 139 TestStream* stream = new TestStream(id, this);
140 ActivateStream(stream);
141 return stream;
140 } 142 }
141 } 143 }
142 144
143 bool IsClosedStream(QuicStreamId id) { 145 bool IsClosedStream(QuicStreamId id) {
144 return QuicSession::IsClosedStream(id); 146 return QuicSession::IsClosedStream(id);
145 } 147 }
146 148
147 ReliableQuicStream* GetOrCreateDynamicStream(QuicStreamId stream_id) { 149 ReliableQuicStream* GetOrCreateDynamicStream(QuicStreamId stream_id) {
148 return QuicSpdySession::GetOrCreateDynamicStream(stream_id); 150 return QuicSpdySession::GetOrCreateDynamicStream(stream_id);
149 } 151 }
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 session_.max_open_incoming_streams()); 1209 session_.max_open_incoming_streams());
1208 } 1210 }
1209 1211
1210 EXPECT_EQ(session_.max_open_outgoing_streams(), 1212 EXPECT_EQ(session_.max_open_outgoing_streams(),
1211 kDefaultMaxStreamsPerConnection); 1213 kDefaultMaxStreamsPerConnection);
1212 } 1214 }
1213 1215
1214 } // namespace 1216 } // namespace
1215 } // namespace test 1217 } // namespace test
1216 } // namespace net 1218 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/tools/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698