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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 668 |
669 QuicStreamRequest::~QuicStreamRequest() { | 669 QuicStreamRequest::~QuicStreamRequest() { |
670 if (factory_ && !callback_.is_null()) | 670 if (factory_ && !callback_.is_null()) |
671 factory_->CancelRequest(this); | 671 factory_->CancelRequest(this); |
672 } | 672 } |
673 | 673 |
674 int QuicStreamRequest::Request(const HostPortPair& destination, | 674 int QuicStreamRequest::Request(const HostPortPair& destination, |
675 PrivacyMode privacy_mode, | 675 PrivacyMode privacy_mode, |
676 int cert_verify_flags, | 676 int cert_verify_flags, |
677 const GURL& url, | 677 const GURL& url, |
678 base::StringPiece method, | 678 QuicStringPiece method, |
679 const NetLogWithSource& net_log, | 679 const NetLogWithSource& net_log, |
680 const CompletionCallback& callback) { | 680 const CompletionCallback& callback) { |
681 DCHECK(callback_.is_null()); | 681 DCHECK(callback_.is_null()); |
682 DCHECK(factory_); | 682 DCHECK(factory_); |
683 server_id_ = QuicServerId(HostPortPair::FromURL(url), privacy_mode); | 683 server_id_ = QuicServerId(HostPortPair::FromURL(url), privacy_mode); |
684 | 684 |
685 int rv = factory_->Create(server_id_, destination, cert_verify_flags, url, | 685 int rv = factory_->Create(server_id_, destination, cert_verify_flags, url, |
686 method, net_log, this); | 686 method, net_log, this); |
687 if (rv == ERR_IO_PENDING) { | 687 if (rv == ERR_IO_PENDING) { |
688 net_log_ = net_log; | 688 net_log_ = net_log; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 } | 960 } |
961 } | 961 } |
962 | 962 |
963 return false; | 963 return false; |
964 } | 964 } |
965 | 965 |
966 int QuicStreamFactory::Create(const QuicServerId& server_id, | 966 int QuicStreamFactory::Create(const QuicServerId& server_id, |
967 const HostPortPair& destination, | 967 const HostPortPair& destination, |
968 int cert_verify_flags, | 968 int cert_verify_flags, |
969 const GURL& url, | 969 const GURL& url, |
970 base::StringPiece method, | 970 QuicStringPiece method, |
971 const NetLogWithSource& net_log, | 971 const NetLogWithSource& net_log, |
972 QuicStreamRequest* request) { | 972 QuicStreamRequest* request) { |
973 if (clock_skew_detector_.ClockSkewDetected(base::TimeTicks::Now(), | 973 if (clock_skew_detector_.ClockSkewDetected(base::TimeTicks::Now(), |
974 base::Time::Now())) { | 974 base::Time::Now())) { |
975 while (!active_sessions_.empty()) { | 975 while (!active_sessions_.empty()) { |
976 QuicChromiumClientSession* session = active_sessions_.begin()->second; | 976 QuicChromiumClientSession* session = active_sessions_.begin()->second; |
977 OnSessionGoingAway(session); | 977 OnSessionGoingAway(session); |
978 // TODO(rch): actually close the session? | 978 // TODO(rch): actually close the session? |
979 } | 979 } |
980 } | 980 } |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 void QuicStreamFactory::OpenFactory() { | 1983 void QuicStreamFactory::OpenFactory() { |
1984 status_ = OPEN; | 1984 status_ = OPEN; |
1985 } | 1985 } |
1986 | 1986 |
1987 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { | 1987 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { |
1988 if (status_ == OPEN) | 1988 if (status_ == OPEN) |
1989 consecutive_disabled_count_ = 0; | 1989 consecutive_disabled_count_ = 0; |
1990 } | 1990 } |
1991 | 1991 |
1992 } // namespace net | 1992 } // namespace net |
OLD | NEW |