| 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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 explicit TestSession(QuicConnection* connection) | 121 explicit TestSession(QuicConnection* connection) |
| 122 : QuicSpdySession(connection, DefaultQuicConfig()), | 122 : QuicSpdySession(connection, DefaultQuicConfig()), |
| 123 crypto_stream_(this), | 123 crypto_stream_(this), |
| 124 writev_consumes_all_data_(false) { | 124 writev_consumes_all_data_(false) { |
| 125 Initialize(); | 125 Initialize(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 TestCryptoStream* GetCryptoStream() override { return &crypto_stream_; } | 128 TestCryptoStream* GetCryptoStream() override { return &crypto_stream_; } |
| 129 | 129 |
| 130 TestStream* CreateOutgoingDynamicStream() override { | 130 TestStream* CreateOutgoingDynamicStream() override { |
| 131 TestStream* stream = new TestStream(GetNextStreamId(), this); | 131 TestStream* stream = new TestStream(GetNextOutgoingStreamId(), this); |
| 132 ActivateStream(stream); | 132 ActivateStream(stream); |
| 133 return stream; | 133 return stream; |
| 134 } | 134 } |
| 135 | 135 |
| 136 TestStream* CreateIncomingDynamicStream(QuicStreamId id) override { | 136 TestStream* CreateIncomingDynamicStream(QuicStreamId id) override { |
| 137 // Enforce the limit on the number of open streams. | 137 // Enforce the limit on the number of open streams. |
| 138 if (GetNumOpenStreams() + 1 > get_max_open_streams()) { | 138 if (GetNumOpenStreams() + 1 > get_max_open_streams()) { |
| 139 connection()->SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS); | 139 connection()->SendConnectionClose(QUIC_TOO_MANY_OPEN_STREAMS); |
| 140 return nullptr; | 140 return nullptr; |
| 141 } else { | 141 } else { |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 // Verify that there is no entry for the stream in | 1073 // Verify that there is no entry for the stream in |
| 1074 // locally_closed_streams_highest_offset_. | 1074 // locally_closed_streams_highest_offset_. |
| 1075 EXPECT_EQ( | 1075 EXPECT_EQ( |
| 1076 FLAGS_quic_fix_fin_accounting ? 0u : 1u, | 1076 FLAGS_quic_fix_fin_accounting ? 0u : 1u, |
| 1077 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); | 1077 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 } // namespace | 1080 } // namespace |
| 1081 } // namespace test | 1081 } // namespace test |
| 1082 } // namespace net | 1082 } // namespace net |
| OLD | NEW |