| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/tools/quic/test_tools/quic_test_server.h" | 5 #include "net/tools/quic/test_tools/quic_test_server.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 QuicTestServer::CryptoStreamFactory* crypto_stream_factory) | 37 QuicTestServer::CryptoStreamFactory* crypto_stream_factory) |
| 38 : QuicSimpleServerSession(config, connection, visitor, crypto_config), | 38 : QuicSimpleServerSession(config, connection, visitor, crypto_config), |
| 39 stream_factory_(factory), | 39 stream_factory_(factory), |
| 40 crypto_stream_factory_(crypto_stream_factory) {} | 40 crypto_stream_factory_(crypto_stream_factory) {} |
| 41 | 41 |
| 42 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override { | 42 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override { |
| 43 if (!ShouldCreateIncomingDynamicStream(id)) { | 43 if (!ShouldCreateIncomingDynamicStream(id)) { |
| 44 return nullptr; | 44 return nullptr; |
| 45 } | 45 } |
| 46 if (stream_factory_) { | 46 if (stream_factory_) { |
| 47 return stream_factory_->CreateStream(id, this); | 47 QuicSpdyStream* stream = stream_factory_->CreateStream(id, this); |
| 48 ActivateStream(stream); |
| 49 return stream; |
| 48 } | 50 } |
| 49 return QuicSimpleServerSession::CreateIncomingDynamicStream(id); | 51 return QuicSimpleServerSession::CreateIncomingDynamicStream(id); |
| 50 } | 52 } |
| 51 | 53 |
| 52 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( | 54 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( |
| 53 const QuicCryptoServerConfig* crypto_config) override { | 55 const QuicCryptoServerConfig* crypto_config) override { |
| 54 if (crypto_stream_factory_) { | 56 if (crypto_stream_factory_) { |
| 55 return crypto_stream_factory_->CreateCryptoStream(crypto_config, this); | 57 return crypto_stream_factory_->CreateCryptoStream(crypto_config, this); |
| 56 } | 58 } |
| 57 return QuicSimpleServerSession::CreateQuicCryptoServerStream(crypto_config); | 59 return QuicSimpleServerSession::CreateQuicCryptoServerStream(crypto_config); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const QuicConfig& config, | 165 const QuicConfig& config, |
| 164 QuicConnection* connection, | 166 QuicConnection* connection, |
| 165 QuicServerSessionVisitor* visitor, | 167 QuicServerSessionVisitor* visitor, |
| 166 const QuicCryptoServerConfig* crypto_config) | 168 const QuicCryptoServerConfig* crypto_config) |
| 167 : QuicSimpleServerSession(config, connection, visitor, crypto_config) { | 169 : QuicSimpleServerSession(config, connection, visitor, crypto_config) { |
| 168 SendGoAway(QUIC_PEER_GOING_AWAY, ""); | 170 SendGoAway(QUIC_PEER_GOING_AWAY, ""); |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace test | 173 } // namespace test |
| 172 } // namespace net | 174 } // namespace net |
| OLD | NEW |