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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 } | 1415 } |
1416 | 1416 |
1417 bool QuicStreamFactory::HasActiveCertVerifierJob( | 1417 bool QuicStreamFactory::HasActiveCertVerifierJob( |
1418 const QuicServerId& server_id) const { | 1418 const QuicServerId& server_id) const { |
1419 return base::ContainsKey(active_cert_verifier_jobs_, server_id); | 1419 return base::ContainsKey(active_cert_verifier_jobs_, server_id); |
1420 } | 1420 } |
1421 | 1421 |
1422 int QuicStreamFactory::ConfigureSocket(DatagramClientSocket* socket, | 1422 int QuicStreamFactory::ConfigureSocket(DatagramClientSocket* socket, |
1423 IPEndPoint addr, | 1423 IPEndPoint addr, |
1424 NetworkHandle network) { | 1424 NetworkHandle network) { |
1425 socket->UseNonBlockingIO(); | |
1426 | |
1427 int rv; | 1425 int rv; |
1428 if (migrate_sessions_on_network_change_) { | 1426 if (migrate_sessions_on_network_change_) { |
1429 // If caller leaves network unspecified, use current default network. | 1427 // If caller leaves network unspecified, use current default network. |
1430 if (network == NetworkChangeNotifier::kInvalidNetworkHandle) { | 1428 if (network == NetworkChangeNotifier::kInvalidNetworkHandle) { |
1431 rv = socket->ConnectUsingDefaultNetwork(addr); | 1429 rv = socket->ConnectUsingDefaultNetwork(addr); |
1432 } else { | 1430 } else { |
1433 rv = socket->ConnectUsingNetwork(network, addr); | 1431 rv = socket->ConnectUsingNetwork(network, addr); |
1434 } | 1432 } |
1435 } else { | 1433 } else { |
1436 rv = socket->Connect(addr); | 1434 rv = socket->Connect(addr); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 // Since the session was active, there's no longer an | 1730 // Since the session was active, there's no longer an |
1733 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1731 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
1734 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1732 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
1735 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1733 // it as recently broken, which means that 0-RTT will be disabled but we'll |
1736 // still race. | 1734 // still race. |
1737 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1735 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
1738 alternative_service); | 1736 alternative_service); |
1739 } | 1737 } |
1740 | 1738 |
1741 } // namespace net | 1739 } // namespace net |
OLD | NEW |