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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 if (http_server_properties_) { | 707 if (http_server_properties_) { |
708 const HttpServerProperties::NetworkStats* stats = | 708 const HttpServerProperties::NetworkStats* stats = |
709 http_server_properties_->GetServerNetworkStats(host_port_pair); | 709 http_server_properties_->GetServerNetworkStats(host_port_pair); |
710 if (stats != NULL) { | 710 if (stats != NULL) { |
711 config.set_initial_round_trip_time_us(stats->rtt.InMicroseconds(), | 711 config.set_initial_round_trip_time_us(stats->rtt.InMicroseconds(), |
712 stats->rtt.InMicroseconds()); | 712 stats->rtt.InMicroseconds()); |
713 } | 713 } |
714 } | 714 } |
715 | 715 |
716 *session = new QuicClientSession( | 716 *session = new QuicClientSession( |
717 connection, socket.Pass(), writer.Pass(), this, server_info.Pass(), | 717 connection, socket.Pass(), writer.Pass(), this, |
718 quic_crypto_client_stream_factory_, session_key, config, crypto_config, | 718 quic_crypto_client_stream_factory_, server_info.Pass(), session_key, |
719 net_log.net_log()); | 719 config, crypto_config, net_log.net_log()); |
720 all_sessions_.insert(*session); // owning pointer | 720 all_sessions_.insert(*session); // owning pointer |
721 if (is_https) { | 721 if (is_https) { |
722 crypto_config->SetProofVerifier( | 722 crypto_config->SetProofVerifier( |
723 new ProofVerifierChromium(cert_verifier, net_log)); | 723 new ProofVerifierChromium(cert_verifier, net_log)); |
724 } | 724 } |
725 return OK; | 725 return OK; |
726 } | 726 } |
727 | 727 |
728 bool QuicStreamFactory::HasActiveJob(const QuicSessionKey& key) const { | 728 bool QuicStreamFactory::HasActiveJob(const QuicSessionKey& key) const { |
729 return ContainsKey(active_jobs_, key); | 729 return ContainsKey(active_jobs_, key); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 base::TimeTicks when = broken_alternate_protocol_list_.front().when; | 821 base::TimeTicks when = broken_alternate_protocol_list_.front().when; |
822 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 822 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
823 base::MessageLoop::current()->PostDelayedTask( | 823 base::MessageLoop::current()->PostDelayedTask( |
824 FROM_HERE, | 824 FROM_HERE, |
825 base::Bind(&QuicStreamFactory::ExpireBrokenAlternateProtocolMappings, | 825 base::Bind(&QuicStreamFactory::ExpireBrokenAlternateProtocolMappings, |
826 weak_factory_.GetWeakPtr()), | 826 weak_factory_.GetWeakPtr()), |
827 delay); | 827 delay); |
828 } | 828 } |
829 | 829 |
830 } // namespace net | 830 } // namespace net |
OLD | NEW |