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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 DCHECK(rv != ERR_IO_PENDING); | 299 DCHECK(rv != ERR_IO_PENDING); |
300 DCHECK(!session_); | 300 DCHECK(!session_); |
301 return rv; | 301 return rv; |
302 } | 302 } |
303 | 303 |
304 session_->StartReading(); | 304 session_->StartReading(); |
305 if (!session_->connection()->connected()) { | 305 if (!session_->connection()->connected()) { |
306 return ERR_QUIC_PROTOCOL_ERROR; | 306 return ERR_QUIC_PROTOCOL_ERROR; |
307 } | 307 } |
308 bool require_confirmation = | 308 bool require_confirmation = |
309 factory_->require_confirmation() || server_id_.is_https() || is_post_ || | 309 factory_->require_confirmation() || is_post_ || |
310 was_alternate_protocol_recently_broken_; | 310 was_alternate_protocol_recently_broken_; |
311 rv = session_->CryptoConnect( | 311 rv = session_->CryptoConnect( |
312 require_confirmation, | 312 require_confirmation, |
313 base::Bind(&QuicStreamFactory::Job::OnIOComplete, | 313 base::Bind(&QuicStreamFactory::Job::OnIOComplete, |
314 base::Unretained(this))); | 314 base::Unretained(this))); |
315 return rv; | 315 return rv; |
316 } | 316 } |
317 | 317 |
318 int QuicStreamFactory::Job::DoConnectComplete(int rv) { | 318 int QuicStreamFactory::Job::DoConnectComplete(int rv) { |
319 if (rv != OK) | 319 if (rv != OK) |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 } | 822 } |
823 | 823 |
824 HttpServerProperties::NetworkStats network_stats; | 824 HttpServerProperties::NetworkStats network_stats; |
825 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); | 825 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); |
826 network_stats.bandwidth_estimate = stats.estimated_bandwidth; | 826 network_stats.bandwidth_estimate = stats.estimated_bandwidth; |
827 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(), | 827 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(), |
828 network_stats); | 828 network_stats); |
829 } | 829 } |
830 | 830 |
831 } // namespace net | 831 } // namespace net |
OLD | NEW |