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

Side by Side Diff: net/tools/quic/quic_server_session.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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_client_session_test.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | 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) 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_server_session.h" 5 #include "net/tools/quic/quic_server_session.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/crypto/cached_network_parameters.h" 8 #include "net/quic/crypto/cached_network_parameters.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 20 matching lines...) Expand all
31 crypto_stream_.reset(CreateQuicCryptoServerStream(crypto_config)); 31 crypto_stream_.reset(CreateQuicCryptoServerStream(crypto_config));
32 } 32 }
33 33
34 QuicCryptoServerStream* QuicServerSession::CreateQuicCryptoServerStream( 34 QuicCryptoServerStream* QuicServerSession::CreateQuicCryptoServerStream(
35 const QuicCryptoServerConfig& crypto_config) { 35 const QuicCryptoServerConfig& crypto_config) {
36 return new QuicCryptoServerStream(crypto_config, this); 36 return new QuicCryptoServerStream(crypto_config, this);
37 } 37 }
38 38
39 void QuicServerSession::OnConfigNegotiated() { 39 void QuicServerSession::OnConfigNegotiated() {
40 QuicSession::OnConfigNegotiated(); 40 QuicSession::OnConfigNegotiated();
41 if (!FLAGS_enable_quic_fec || 41
42 !config()->HasReceivedConnectionOptions() || 42 if (!config()->HasReceivedConnectionOptions()) {
43 !net::ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) {
44 return; 43 return;
45 } 44 }
46 // kFHDR config maps to FEC protection always for headers stream. 45
47 // TODO(jri): Add crypto stream in addition to headers for kHDR. 46 // If the client has provided a bandwidth estimate from the same serving
48 headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); 47 // region, then pass it to the sent packet manager in preparation for possible
48 // bandwidth resumption.
49 const CachedNetworkParameters* cached_network_params =
50 crypto_stream_->previous_cached_network_params();
51 if (FLAGS_quic_enable_bandwidth_resumption_experiment &&
52 cached_network_params != nullptr &&
53 ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWRE) &&
54 cached_network_params->serving_region() == serving_region_) {
55 connection()->ResumeConnectionState(*cached_network_params);
56 }
57
58 if (FLAGS_enable_quic_fec &&
59 ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) {
60 // kFHDR config maps to FEC protection always for headers stream.
61 // TODO(jri): Add crypto stream in addition to headers for kHDR.
62 headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS);
63 }
49 } 64 }
50 65
51 void QuicServerSession::OnConnectionClosed(QuicErrorCode error, 66 void QuicServerSession::OnConnectionClosed(QuicErrorCode error,
52 bool from_peer) { 67 bool from_peer) {
53 QuicSession::OnConnectionClosed(error, from_peer); 68 QuicSession::OnConnectionClosed(error, from_peer);
54 // In the unlikely event we get a connection close while doing an asynchronous 69 // In the unlikely event we get a connection close while doing an asynchronous
55 // crypto event, make sure we cancel the callback. 70 // crypto event, make sure we cancel the callback.
56 if (crypto_stream_.get() != nullptr) { 71 if (crypto_stream_.get() != nullptr) {
57 crypto_stream_->CancelOutstandingCallbacks(); 72 crypto_stream_->CancelOutstandingCallbacks();
58 } 73 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 DLOG(ERROR) << "Server push not yet supported"; 189 DLOG(ERROR) << "Server push not yet supported";
175 return nullptr; 190 return nullptr;
176 } 191 }
177 192
178 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { 193 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() {
179 return crypto_stream_.get(); 194 return crypto_stream_.get();
180 } 195 }
181 196
182 } // namespace tools 197 } // namespace tools
183 } // namespace net 198 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698