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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 NetworkChangeNotifier::RemoveNetworkObserver(this); | 684 NetworkChangeNotifier::RemoveNetworkObserver(this); |
685 } else if (close_sessions_on_ip_change_) { | 685 } else if (close_sessions_on_ip_change_) { |
686 NetworkChangeNotifier::RemoveIPAddressObserver(this); | 686 NetworkChangeNotifier::RemoveIPAddressObserver(this); |
687 } | 687 } |
688 } | 688 } |
689 | 689 |
690 void QuicStreamFactory::set_require_confirmation(bool require_confirmation) { | 690 void QuicStreamFactory::set_require_confirmation(bool require_confirmation) { |
691 require_confirmation_ = require_confirmation; | 691 require_confirmation_ = require_confirmation; |
692 if (!(local_address_ == IPEndPoint())) { | 692 if (!(local_address_ == IPEndPoint())) { |
693 http_server_properties_->SetSupportsQuic(!require_confirmation, | 693 http_server_properties_->SetSupportsQuic(!require_confirmation, |
694 local_address_.address()); | 694 local_address_.address().bytes()); |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 bool QuicStreamFactory::ZeroRTTEnabledFor(const QuicServerId& quic_server_id) { | 698 bool QuicStreamFactory::ZeroRTTEnabledFor(const QuicServerId& quic_server_id) { |
699 return !(require_confirmation_ || CryptoConfigCacheIsEmpty(quic_server_id)); | 699 return !(require_confirmation_ || CryptoConfigCacheIsEmpty(quic_server_id)); |
700 } | 700 } |
701 | 701 |
702 base::TimeDelta QuicStreamFactory::GetTimeDelayForWaitingJob( | 702 base::TimeDelta QuicStreamFactory::GetTimeDelayForWaitingJob( |
703 const QuicServerId& server_id) { | 703 const QuicServerId& server_id) { |
704 if (!delay_tcp_race_ || require_confirmation_) | 704 if (!delay_tcp_race_ || require_confirmation_) |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 if (rv != OK) { | 1362 if (rv != OK) { |
1363 HistogramCreateSessionFailure(CREATION_ERROR_SETTING_SEND_BUFFER); | 1363 HistogramCreateSessionFailure(CREATION_ERROR_SETTING_SEND_BUFFER); |
1364 return rv; | 1364 return rv; |
1365 } | 1365 } |
1366 | 1366 |
1367 socket->GetLocalAddress(&local_address_); | 1367 socket->GetLocalAddress(&local_address_); |
1368 if (check_persisted_supports_quic_) { | 1368 if (check_persisted_supports_quic_) { |
1369 check_persisted_supports_quic_ = false; | 1369 check_persisted_supports_quic_ = false; |
1370 IPAddressNumber last_address; | 1370 IPAddressNumber last_address; |
1371 if (http_server_properties_->GetSupportsQuic(&last_address) && | 1371 if (http_server_properties_->GetSupportsQuic(&last_address) && |
1372 last_address == local_address_.address()) { | 1372 last_address == local_address_.address().bytes()) { |
1373 require_confirmation_ = false; | 1373 require_confirmation_ = false; |
1374 } | 1374 } |
1375 } | 1375 } |
1376 | 1376 |
1377 return OK; | 1377 return OK; |
1378 } | 1378 } |
1379 | 1379 |
1380 int QuicStreamFactory::CreateSession(const QuicServerId& server_id, | 1380 int QuicStreamFactory::CreateSession(const QuicServerId& server_id, |
1381 int cert_verify_flags, | 1381 int cert_verify_flags, |
1382 scoped_ptr<QuicServerInfo> server_info, | 1382 scoped_ptr<QuicServerInfo> server_info, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 // Since the session was active, there's no longer an | 1624 // Since the session was active, there's no longer an |
1625 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1625 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
1626 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1626 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
1627 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1627 // it as recently broken, which means that 0-RTT will be disabled but we'll |
1628 // still race. | 1628 // still race. |
1629 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1629 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
1630 alternative_service); | 1630 alternative_service); |
1631 } | 1631 } |
1632 | 1632 |
1633 } // namespace net | 1633 } // namespace net |
OLD | NEW |