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/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace test { | 27 namespace test { |
28 | 28 |
29 class CustomStreamSession : public QuicServerSession { | 29 class CustomStreamSession : public QuicServerSession { |
30 public: | 30 public: |
31 CustomStreamSession(const QuicConfig& config, | 31 CustomStreamSession(const QuicConfig& config, |
32 QuicConnection* connection, | 32 QuicConnection* connection, |
33 QuicServerSessionVisitor* visitor, | 33 QuicServerSessionVisitor* visitor, |
34 const QuicCryptoServerConfig* crypto_config, | 34 const QuicCryptoServerConfig* crypto_config, |
35 QuicTestServer::StreamCreationFunction creator) | 35 QuicTestServer::StreamCreationFunction creator) |
36 : QuicServerSession(config, connection, visitor, crypto_config), | 36 : QuicServerSession(config, connection, visitor, crypto_config), |
| 37 // TODO(rtenneti): use std::move when chromium supports it. |
37 stream_creator_(creator) {} | 38 stream_creator_(creator) {} |
38 | 39 |
39 QuicSpdyServerStream* CreateIncomingDynamicStream(QuicStreamId id) override { | 40 QuicSpdyServerStream* CreateIncomingDynamicStream(QuicStreamId id) override { |
40 if (!ShouldCreateIncomingDynamicStream(id)) { | 41 if (!ShouldCreateIncomingDynamicStream(id)) { |
41 return nullptr; | 42 return nullptr; |
42 } | 43 } |
43 return stream_creator_(id, this); | 44 return stream_creator_(id, this); |
44 } | 45 } |
45 | 46 |
46 private: | 47 private: |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 QuicConnection* connection, | 137 QuicConnection* connection, |
137 QuicServerSessionVisitor* visitor, | 138 QuicServerSessionVisitor* visitor, |
138 const QuicCryptoServerConfig* crypto_config) | 139 const QuicCryptoServerConfig* crypto_config) |
139 : QuicServerSession(config, connection, visitor, crypto_config) { | 140 : QuicServerSession(config, connection, visitor, crypto_config) { |
140 SendGoAway(QUIC_PEER_GOING_AWAY, ""); | 141 SendGoAway(QUIC_PEER_GOING_AWAY, ""); |
141 } | 142 } |
142 | 143 |
143 } // namespace test | 144 } // namespace test |
144 } // namespace tools | 145 } // namespace tools |
145 } // namespace net | 146 } // namespace net |
OLD | NEW |