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 19 matching lines...) Expand all Loading... |
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 // TODO(rtenneti): use std::move when chromium supports it. |
38 stream_creator_(creator) {} | 38 stream_creator_(creator) {} |
39 | 39 |
40 QuicSpdyServerStream* CreateIncomingDynamicStream(QuicStreamId id) override { | 40 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override { |
41 if (!ShouldCreateIncomingDynamicStream(id)) { | 41 if (!ShouldCreateIncomingDynamicStream(id)) { |
42 return nullptr; | 42 return nullptr; |
43 } | 43 } |
44 return stream_creator_(id, this); | 44 return stream_creator_(id, this); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 QuicTestServer::StreamCreationFunction stream_creator_; | 48 QuicTestServer::StreamCreationFunction stream_creator_; |
49 }; | 49 }; |
50 | 50 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 QuicConnection* connection, | 137 QuicConnection* connection, |
138 QuicServerSessionVisitor* visitor, | 138 QuicServerSessionVisitor* visitor, |
139 const QuicCryptoServerConfig* crypto_config) | 139 const QuicCryptoServerConfig* crypto_config) |
140 : QuicServerSession(config, connection, visitor, crypto_config) { | 140 : QuicServerSession(config, connection, visitor, crypto_config) { |
141 SendGoAway(QUIC_PEER_GOING_AWAY, ""); | 141 SendGoAway(QUIC_PEER_GOING_AWAY, ""); |
142 } | 142 } |
143 | 143 |
144 } // namespace test | 144 } // namespace test |
145 } // namespace tools | 145 } // namespace tools |
146 } // namespace net | 146 } // namespace net |
OLD | NEW |