| 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/quic_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 } | 775 } |
| 776 | 776 |
| 777 bool QuicStreamFactory::HasActiveJob(const QuicServerId& key) const { | 777 bool QuicStreamFactory::HasActiveJob(const QuicServerId& key) const { |
| 778 return ContainsKey(active_jobs_, key); | 778 return ContainsKey(active_jobs_, key); |
| 779 } | 779 } |
| 780 | 780 |
| 781 void QuicStreamFactory::ActivateSession( | 781 void QuicStreamFactory::ActivateSession( |
| 782 const QuicServerId& server_id, | 782 const QuicServerId& server_id, |
| 783 QuicClientSession* session) { | 783 QuicClientSession* session) { |
| 784 DCHECK(!HasActiveSession(server_id)); | 784 DCHECK(!HasActiveSession(server_id)); |
| 785 UMA_HISTOGRAM_COUNTS("Net.QuicActiveSessions", active_sessions_.size()); |
| 785 active_sessions_[server_id] = session; | 786 active_sessions_[server_id] = session; |
| 786 session_aliases_[session].insert(server_id); | 787 session_aliases_[session].insert(server_id); |
| 787 const IpAliasKey ip_alias_key(session->connection()->peer_address(), | 788 const IpAliasKey ip_alias_key(session->connection()->peer_address(), |
| 788 server_id.is_https()); | 789 server_id.is_https()); |
| 789 DCHECK(!ContainsKey(ip_aliases_[ip_alias_key], session)); | 790 DCHECK(!ContainsKey(ip_aliases_[ip_alias_key], session)); |
| 790 ip_aliases_[ip_alias_key].insert(session); | 791 ip_aliases_[ip_alias_key].insert(session); |
| 791 } | 792 } |
| 792 | 793 |
| 793 void QuicStreamFactory::InitializeCachedStateInCryptoConfig( | 794 void QuicStreamFactory::InitializeCachedStateInCryptoConfig( |
| 794 const QuicServerId& server_id, | 795 const QuicServerId& server_id, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 // differently so that we still race TCP but we don't consider the | 841 // differently so that we still race TCP but we don't consider the |
| 841 // session connected until the handshake has been confirmed. | 842 // session connected until the handshake has been confirmed. |
| 842 HistogramBrokenAlternateProtocolLocation( | 843 HistogramBrokenAlternateProtocolLocation( |
| 843 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); | 844 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); |
| 844 http_server_properties_->SetBrokenAlternateProtocol( | 845 http_server_properties_->SetBrokenAlternateProtocol( |
| 845 server_id.host_port_pair()); | 846 server_id.host_port_pair()); |
| 846 } | 847 } |
| 847 } | 848 } |
| 848 | 849 |
| 849 } // namespace net | 850 } // namespace net |
| OLD | NEW |