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

Side by Side Diff: net/tools/quic/quic_simple_server_session.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
OLDNEW
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/tools/quic/quic_simple_server_session.h" 5 #include "net/tools/quic/quic_simple_server_session.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "net/quic/proto/cached_network_parameters.pb.h" 9 #include "net/quic/proto/cached_network_parameters.pb.h"
10 #include "net/quic/quic_connection.h" 10 #include "net/quic/quic_connection.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Procese promised push request as many as possible. 66 // Procese promised push request as many as possible.
67 HandlePromisedPushRequests(); 67 HandlePromisedPushRequests();
68 } 68 }
69 69
70 QuicSpdyStream* QuicSimpleServerSession::CreateIncomingDynamicStream( 70 QuicSpdyStream* QuicSimpleServerSession::CreateIncomingDynamicStream(
71 QuicStreamId id) { 71 QuicStreamId id) {
72 if (!ShouldCreateIncomingDynamicStream(id)) { 72 if (!ShouldCreateIncomingDynamicStream(id)) {
73 return nullptr; 73 return nullptr;
74 } 74 }
75 75
76 return new QuicSimpleServerStream(id, this); 76 QuicSpdyStream* stream = new QuicSimpleServerStream(id, this);
77 ActivateStream(stream);
78 return stream;
77 } 79 }
78 80
79 QuicSimpleServerStream* QuicSimpleServerSession::CreateOutgoingDynamicStream( 81 QuicSimpleServerStream* QuicSimpleServerSession::CreateOutgoingDynamicStream(
80 SpdyPriority priority) { 82 SpdyPriority priority) {
81 if (!ShouldCreateOutgoingDynamicStream()) { 83 if (!ShouldCreateOutgoingDynamicStream()) {
82 return nullptr; 84 return nullptr;
83 } 85 }
84 86
85 QuicSimpleServerStream* stream = 87 QuicSimpleServerStream* stream =
86 new QuicSimpleServerStream(GetNextOutgoingStreamId(), this); 88 new QuicSimpleServerStream(GetNextOutgoingStreamId(), this);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DVLOG(1) << "created server push stream " << promised_stream->id(); 178 DVLOG(1) << "created server push stream " << promised_stream->id();
177 179
178 const SpdyHeaderBlock request_headers(promised_info.request_headers); 180 const SpdyHeaderBlock request_headers(promised_info.request_headers);
179 181
180 promised_streams_.pop_front(); 182 promised_streams_.pop_front();
181 promised_stream->PushResponse(request_headers); 183 promised_stream->PushResponse(request_headers);
182 } 184 }
183 } 185 }
184 186
185 } // namespace net 187 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_session_base_test.cc ('k') | net/tools/quic/quic_simple_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698