| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "net/quic/core/proto/cached_network_parameters.pb.h" | 11 #include "net/quic/core/proto/cached_network_parameters.pb.h" |
| 12 #include "net/quic/core/quic_connection.h" | 12 #include "net/quic/core/quic_connection.h" |
| 13 #include "net/quic/core/quic_flags.h" | 13 #include "net/quic/core/quic_flags.h" |
| 14 #include "net/quic/core/quic_spdy_session.h" | 14 #include "net/quic/core/quic_spdy_session.h" |
| 15 #include "net/quic/core/reliable_quic_stream.h" | 15 #include "net/quic/core/reliable_quic_stream.h" |
| 16 #include "net/tools/quic/quic_simple_server_stream.h" | 16 #include "net/tools/quic/quic_simple_server_stream.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 using std::string; | 19 using std::string; |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 QuicSimpleServerSession::QuicSimpleServerSession( | 23 QuicSimpleServerSession::QuicSimpleServerSession( |
| 24 const QuicConfig& config, | 24 const QuicConfig& config, |
| 25 QuicConnection* connection, | 25 QuicConnection* connection, |
| 26 QuicServerSessionBase::Visitor* visitor, | 26 QuicServerSessionBase::Visitor* visitor, |
| 27 QuicServerSessionBase::Helper* helper, | 27 QuicCryptoServerStream::Helper* helper, |
| 28 const QuicCryptoServerConfig* crypto_config, | 28 const QuicCryptoServerConfig* crypto_config, |
| 29 QuicCompressedCertsCache* compressed_certs_cache) | 29 QuicCompressedCertsCache* compressed_certs_cache) |
| 30 : QuicServerSessionBase(config, | 30 : QuicServerSessionBase(config, |
| 31 connection, | 31 connection, |
| 32 visitor, | 32 visitor, |
| 33 helper, | 33 helper, |
| 34 crypto_config, | 34 crypto_config, |
| 35 compressed_certs_cache), | 35 compressed_certs_cache), |
| 36 highest_promised_stream_id_(0) {} | 36 highest_promised_stream_id_(0) {} |
| 37 | 37 |
| 38 QuicSimpleServerSession::~QuicSimpleServerSession() { | 38 QuicSimpleServerSession::~QuicSimpleServerSession() { |
| 39 delete connection(); | 39 delete connection(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 QuicCryptoServerStreamBase* | 42 QuicCryptoServerStreamBase* |
| 43 QuicSimpleServerSession::CreateQuicCryptoServerStream( | 43 QuicSimpleServerSession::CreateQuicCryptoServerStream( |
| 44 const QuicCryptoServerConfig* crypto_config, | 44 const QuicCryptoServerConfig* crypto_config, |
| 45 QuicCompressedCertsCache* compressed_certs_cache) { | 45 QuicCompressedCertsCache* compressed_certs_cache) { |
| 46 return new QuicCryptoServerStream(crypto_config, compressed_certs_cache, | 46 return new QuicCryptoServerStream(crypto_config, compressed_certs_cache, |
| 47 FLAGS_enable_quic_stateless_reject_support, | 47 FLAGS_enable_quic_stateless_reject_support, |
| 48 this); | 48 this, stream_helper()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void QuicSimpleServerSession::StreamDraining(QuicStreamId id) { | 51 void QuicSimpleServerSession::StreamDraining(QuicStreamId id) { |
| 52 QuicSpdySession::StreamDraining(id); | 52 QuicSpdySession::StreamDraining(id); |
| 53 if (!IsIncomingStream(id)) { | 53 if (!IsIncomingStream(id)) { |
| 54 HandlePromisedPushRequests(); | 54 HandlePromisedPushRequests(); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 void QuicSimpleServerSession::OnStreamFrame(const QuicStreamFrame& frame) { | 58 void QuicSimpleServerSession::OnStreamFrame(const QuicStreamFrame& frame) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 DVLOG(1) << "created server push stream " << promised_stream->id(); | 200 DVLOG(1) << "created server push stream " << promised_stream->id(); |
| 201 | 201 |
| 202 SpdyHeaderBlock request_headers(std::move(promised_info.request_headers)); | 202 SpdyHeaderBlock request_headers(std::move(promised_info.request_headers)); |
| 203 | 203 |
| 204 promised_streams_.pop_front(); | 204 promised_streams_.pop_front(); |
| 205 promised_stream->PushResponse(std::move(request_headers)); | 205 promised_stream->PushResponse(std::move(request_headers)); |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace net | 209 } // namespace net |
| OLD | NEW |