Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: net/tools/quic/test_tools/quic_test_server.cc

Issue 1744103003: QuicSession::CreateIncomingDynamicStream now retains ownership of the created stream. No functional… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_simple_server_session_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server_session_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698