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

Side by Side Diff: net/quic/chromium/quic_stream_factory.cc

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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/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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "net/quic/core/crypto/proof_verifier.h" 43 #include "net/quic/core/crypto/proof_verifier.h"
44 #include "net/quic/core/crypto/properties_based_quic_server_info.h" 44 #include "net/quic/core/crypto/properties_based_quic_server_info.h"
45 #include "net/quic/core/crypto/quic_random.h" 45 #include "net/quic/core/crypto/quic_random.h"
46 #include "net/quic/core/crypto/quic_server_info.h" 46 #include "net/quic/core/crypto/quic_server_info.h"
47 #include "net/quic/core/quic_client_promised_info.h" 47 #include "net/quic/core/quic_client_promised_info.h"
48 #include "net/quic/core/quic_clock.h" 48 #include "net/quic/core/quic_clock.h"
49 #include "net/quic/core/quic_connection.h" 49 #include "net/quic/core/quic_connection.h"
50 #include "net/quic/core/quic_crypto_client_stream_factory.h" 50 #include "net/quic/core/quic_crypto_client_stream_factory.h"
51 #include "net/quic/core/quic_flags.h" 51 #include "net/quic/core/quic_flags.h"
52 #include "net/socket/client_socket_factory.h" 52 #include "net/socket/client_socket_factory.h"
53 #include "net/socket/next_proto.h"
54 #include "net/socket/socket_performance_watcher.h" 53 #include "net/socket/socket_performance_watcher.h"
55 #include "net/socket/socket_performance_watcher_factory.h" 54 #include "net/socket/socket_performance_watcher_factory.h"
56 #include "net/ssl/token_binding.h" 55 #include "net/ssl/token_binding.h"
57 #include "net/udp/udp_client_socket.h" 56 #include "net/udp/udp_client_socket.h"
58 #include "third_party/boringssl/src/include/openssl/aead.h" 57 #include "third_party/boringssl/src/include/openssl/aead.h"
59 #include "url/gurl.h" 58 #include "url/gurl.h"
60 #include "url/url_constants.h" 59 #include "url/url_constants.h"
61 60
62 using std::min; 61 using std::min;
63 using NetworkHandle = net::NetworkChangeNotifier::NetworkHandle; 62 using NetworkHandle = net::NetworkChangeNotifier::NetworkHandle;
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 server_id.host_port_pair().port()); 1733 server_id.host_port_pair().port());
1735 const ServerNetworkStats* stats = 1734 const ServerNetworkStats* stats =
1736 http_server_properties_->GetServerNetworkStats(server); 1735 http_server_properties_->GetServerNetworkStats(server);
1737 if (stats == nullptr) 1736 if (stats == nullptr)
1738 return 0; 1737 return 0;
1739 return stats->srtt.InMicroseconds(); 1738 return stats->srtt.InMicroseconds();
1740 } 1739 }
1741 1740
1742 bool QuicStreamFactory::WasQuicRecentlyBroken( 1741 bool QuicStreamFactory::WasQuicRecentlyBroken(
1743 const QuicServerId& server_id) const { 1742 const QuicServerId& server_id) const {
1744 const AlternativeService alternative_service(kProtoQUIC, 1743 const AlternativeService alternative_service(QUIC,
1745 server_id.host_port_pair()); 1744 server_id.host_port_pair());
1746 return http_server_properties_->WasAlternativeServiceRecentlyBroken( 1745 return http_server_properties_->WasAlternativeServiceRecentlyBroken(
1747 alternative_service); 1746 alternative_service);
1748 } 1747 }
1749 1748
1750 bool QuicStreamFactory::CryptoConfigCacheIsEmpty( 1749 bool QuicStreamFactory::CryptoConfigCacheIsEmpty(
1751 const QuicServerId& server_id) { 1750 const QuicServerId& server_id) {
1752 QuicCryptoClientConfig::CachedState* cached = 1751 QuicCryptoClientConfig::CachedState* cached =
1753 crypto_config_.LookupOrCreate(server_id); 1752 crypto_config_.LookupOrCreate(server_id);
1754 return cached->IsEmpty(); 1753 return cached->IsEmpty();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 if (default_alternative_proxy_server.is_quic()) { 1827 if (default_alternative_proxy_server.is_quic()) {
1829 quic_supported_servers_at_startup_.insert( 1828 quic_supported_servers_at_startup_.insert(
1830 default_alternative_proxy_server.host_port_pair()); 1829 default_alternative_proxy_server.host_port_pair());
1831 } 1830 }
1832 1831
1833 for (const std::pair<const url::SchemeHostPort, AlternativeServiceInfoVector>& 1832 for (const std::pair<const url::SchemeHostPort, AlternativeServiceInfoVector>&
1834 key_value : http_server_properties_->alternative_service_map()) { 1833 key_value : http_server_properties_->alternative_service_map()) {
1835 HostPortPair host_port_pair(key_value.first.host(), key_value.first.port()); 1834 HostPortPair host_port_pair(key_value.first.host(), key_value.first.port());
1836 for (const AlternativeServiceInfo& alternative_service_info : 1835 for (const AlternativeServiceInfo& alternative_service_info :
1837 key_value.second) { 1836 key_value.second) {
1838 if (alternative_service_info.alternative_service.protocol == kProtoQUIC) { 1837 if (alternative_service_info.alternative_service.protocol == QUIC) {
1839 quic_supported_servers_at_startup_.insert(host_port_pair); 1838 quic_supported_servers_at_startup_.insert(host_port_pair);
1840 break; 1839 break;
1841 } 1840 }
1842 } 1841 }
1843 } 1842 }
1844 1843
1845 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) 1844 if (http_server_properties_->max_server_configs_stored_in_properties() == 0)
1846 return; 1845 return;
1847 // Create a temporary QuicServerInfo object to deserialize and to populate the 1846 // Create a temporary QuicServerInfo object to deserialize and to populate the
1848 // in-memory crypto server config cache in the MRU order. 1847 // in-memory crypto server config cache in the MRU order.
(...skipping 17 matching lines...) Expand all
1866 } 1865 }
1867 1866
1868 void QuicStreamFactory::ProcessGoingAwaySession( 1867 void QuicStreamFactory::ProcessGoingAwaySession(
1869 QuicChromiumClientSession* session, 1868 QuicChromiumClientSession* session,
1870 const QuicServerId& server_id, 1869 const QuicServerId& server_id,
1871 bool session_was_active) { 1870 bool session_was_active) {
1872 if (!http_server_properties_) 1871 if (!http_server_properties_)
1873 return; 1872 return;
1874 1873
1875 const QuicConnectionStats& stats = session->connection()->GetStats(); 1874 const QuicConnectionStats& stats = session->connection()->GetStats();
1876 const AlternativeService alternative_service(kProtoQUIC, 1875 const AlternativeService alternative_service(QUIC,
1877 server_id.host_port_pair()); 1876 server_id.host_port_pair());
1878 if (session->IsCryptoHandshakeConfirmed()) { 1877 if (session->IsCryptoHandshakeConfirmed()) {
1879 http_server_properties_->ConfirmAlternativeService(alternative_service); 1878 http_server_properties_->ConfirmAlternativeService(alternative_service);
1880 ServerNetworkStats network_stats; 1879 ServerNetworkStats network_stats;
1881 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); 1880 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us);
1882 network_stats.bandwidth_estimate = stats.estimated_bandwidth; 1881 network_stats.bandwidth_estimate = stats.estimated_bandwidth;
1883 url::SchemeHostPort server("https", server_id.host_port_pair().host(), 1882 url::SchemeHostPort server("https", server_id.host_port_pair().host(),
1884 server_id.host_port_pair().port()); 1883 server_id.host_port_pair().port());
1885 http_server_properties_->SetServerNetworkStats(server, network_stats); 1884 http_server_properties_->SetServerNetworkStats(server, network_stats);
1886 return; 1885 return;
(...skipping 24 matching lines...) Expand all
1911 void QuicStreamFactory::OpenFactory() { 1910 void QuicStreamFactory::OpenFactory() {
1912 status_ = OPEN; 1911 status_ = OPEN;
1913 } 1912 }
1914 1913
1915 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { 1914 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() {
1916 if (status_ == OPEN) 1915 if (status_ == OPEN)
1917 consecutive_disabled_count_ = 0; 1916 consecutive_disabled_count_ = 0;
1918 } 1917 }
1919 1918
1920 } // namespace net 1919 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_network_transaction_unittest.cc ('k') | net/quic/chromium/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698