Chromium Code Reviews| Index: net/quic/quic_stream_factory.cc |
| diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc |
| index 6f71095fe9556a900a2ee9c6f85a2cbb5903b317..ea1bbb7135f73b7d78ef11962c1705e1cefe6dfb 100644 |
| --- a/net/quic/quic_stream_factory.cc |
| +++ b/net/quic/quic_stream_factory.cc |
| @@ -71,6 +71,9 @@ const int32 kServerSecureInitialCongestionWindow = 32; |
| // Be conservative, and just use double a typical TCP ICWND for HTTP. |
| const int32 kServerInecureInitialCongestionWindow = 20; |
| +const char kDummyHostname[] = "quic.global.props"; |
| +const uint16 kDummyPort = 0; |
| + |
| void HistogramCreateSessionFailure(enum CreateSessionFailure error) { |
| UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.CreationError", error, |
| CREATION_ERROR_MAX); |
| @@ -525,6 +528,12 @@ QuicStreamFactory::QuicStreamFactory( |
| crypto_config_.PreferAesGcm(); |
| if (!IsEcdsaSupported()) |
| crypto_config_.DisableEcdsa(); |
| + if (http_server_properties_) { |
| + // TODO(rtenneti): Delete host_port_pair and persist data in globals. |
| + HostPortPair host_port_pair(kDummyHostname, kDummyPort); |
| + if (http_server_properties_->GetSupportsQuic(host_port_pair).used_quic) |
| + require_confirmation_ = false; |
|
Ryan Hamilton
2014/09/25 20:59:42
This does not appear to be using the IP address. D
ramant (doing other things)
2014/09/26 00:04:05
Done.
|
| + } |
| } |
| QuicStreamFactory::~QuicStreamFactory() { |
| @@ -536,6 +545,16 @@ QuicStreamFactory::~QuicStreamFactory() { |
| STLDeleteValues(&active_jobs_); |
| } |
| +void QuicStreamFactory::set_require_confirmation(bool require_confirmation) { |
| + require_confirmation_ = require_confirmation; |
| + if (http_server_properties_) { |
| + // TODO(rtenneti): Delete host_port_pair and persist data in globals. |
| + HostPortPair host_port_pair(kDummyHostname, kDummyPort); |
| + http_server_properties_->SetSupportsQuic( |
| + host_port_pair, !require_confirmation, local_address_.ToString()); |
| + } |
| +} |
| + |
| int QuicStreamFactory::Create(const HostPortPair& host_port_pair, |
| bool is_https, |
| PrivacyMode privacy_mode, |
| @@ -616,7 +635,7 @@ bool QuicStreamFactory::OnResolution( |
| void QuicStreamFactory::OnJobComplete(Job* job, int rv) { |
| if (rv == OK) { |
| if (!always_require_handshake_confirmation_) |
| - require_confirmation_ = false; |
| + set_require_confirmation(false); |
| // Create all the streams, but do not notify them yet. |
| for (RequestSet::iterator it = job_requests_map_[job].begin(); |
| @@ -772,7 +791,7 @@ void QuicStreamFactory::ClearCachedStatesInCryptoConfig() { |
| void QuicStreamFactory::OnIPAddressChanged() { |
| CloseAllSessions(ERR_NETWORK_CHANGED); |
| - require_confirmation_ = true; |
| + set_require_confirmation(true); |
| } |
| void QuicStreamFactory::OnCertAdded(const X509Certificate* cert) { |
| @@ -857,6 +876,7 @@ int QuicStreamFactory::CreateSession( |
| return rv; |
| } |
| + socket->GetLocalAddress(&local_address_); |
| DefaultPacketWriterFactory packet_writer_factory(socket.get()); |
| if (!helper_.get()) { |