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/quic/chromium/quic_stream_factory.h" | 5 #include "net/quic/chromium/quic_stream_factory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 void QuicStreamFactory::ProcessGoingAwaySession( | 1940 void QuicStreamFactory::ProcessGoingAwaySession( |
1941 QuicChromiumClientSession* session, | 1941 QuicChromiumClientSession* session, |
1942 const QuicServerId& server_id, | 1942 const QuicServerId& server_id, |
1943 bool session_was_active) { | 1943 bool session_was_active) { |
1944 if (!http_server_properties_) | 1944 if (!http_server_properties_) |
1945 return; | 1945 return; |
1946 | 1946 |
1947 const QuicConnectionStats& stats = session->connection()->GetStats(); | 1947 const QuicConnectionStats& stats = session->connection()->GetStats(); |
1948 const AlternativeService alternative_service(kProtoQUIC, | 1948 const AlternativeService alternative_service(kProtoQUIC, |
1949 server_id.host_port_pair()); | 1949 server_id.host_port_pair()); |
| 1950 url::SchemeHostPort server("https", server_id.host_port_pair().host(), |
| 1951 server_id.host_port_pair().port()); |
1950 if (session->IsCryptoHandshakeConfirmed()) { | 1952 if (session->IsCryptoHandshakeConfirmed()) { |
1951 http_server_properties_->ConfirmAlternativeService(alternative_service); | 1953 http_server_properties_->ConfirmAlternativeService(alternative_service); |
1952 ServerNetworkStats network_stats; | 1954 ServerNetworkStats network_stats; |
1953 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); | 1955 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); |
1954 network_stats.bandwidth_estimate = stats.estimated_bandwidth; | 1956 network_stats.bandwidth_estimate = stats.estimated_bandwidth; |
1955 url::SchemeHostPort server("https", server_id.host_port_pair().host(), | |
1956 server_id.host_port_pair().port()); | |
1957 http_server_properties_->SetServerNetworkStats(server, network_stats); | 1957 http_server_properties_->SetServerNetworkStats(server, network_stats); |
1958 return; | 1958 return; |
1959 } | 1959 } |
1960 | 1960 |
| 1961 http_server_properties_->ClearServerNetworkStats(server); |
| 1962 |
1961 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived", | 1963 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived", |
1962 stats.packets_received); | 1964 stats.packets_received); |
1963 | 1965 |
1964 if (!session_was_active) | 1966 if (!session_was_active) |
1965 return; | 1967 return; |
1966 | 1968 |
1967 // TODO(rch): In the special case where the session has received no | 1969 // TODO(rch): In the special case where the session has received no |
1968 // packets from the peer, we should consider blacklisting this | 1970 // packets from the peer, we should consider blacklisting this |
1969 // differently so that we still race TCP but we don't consider the | 1971 // differently so that we still race TCP but we don't consider the |
1970 // session connected until the handshake has been confirmed. | 1972 // session connected until the handshake has been confirmed. |
(...skipping 12 matching lines...) Expand all Loading... |
1983 void QuicStreamFactory::OpenFactory() { | 1985 void QuicStreamFactory::OpenFactory() { |
1984 status_ = OPEN; | 1986 status_ = OPEN; |
1985 } | 1987 } |
1986 | 1988 |
1987 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { | 1989 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { |
1988 if (status_ == OPEN) | 1990 if (status_ == OPEN) |
1989 consecutive_disabled_count_ = 0; | 1991 consecutive_disabled_count_ = 0; |
1990 } | 1992 } |
1991 | 1993 |
1992 } // namespace net | 1994 } // namespace net |
OLD | NEW |