| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |