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_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 new QuicCryptoClientStream(server_hostname, this, crypto_config)); | 63 new QuicCryptoClientStream(server_hostname, this, crypto_config)); |
64 | 64 |
65 connection->set_debug_visitor(&logger_); | 65 connection->set_debug_visitor(&logger_); |
66 // TODO(rch): pass in full host port proxy pair | 66 // TODO(rch): pass in full host port proxy pair |
67 net_log_.BeginEvent( | 67 net_log_.BeginEvent( |
68 NetLog::TYPE_QUIC_SESSION, | 68 NetLog::TYPE_QUIC_SESSION, |
69 NetLog::StringCallback("host", &server_hostname)); | 69 NetLog::StringCallback("host", &server_hostname)); |
70 } | 70 } |
71 | 71 |
72 QuicClientSession::~QuicClientSession() { | 72 QuicClientSession::~QuicClientSession() { |
73 DCHECK(callback_.is_null()); | |
74 connection()->set_debug_visitor(NULL); | 73 connection()->set_debug_visitor(NULL); |
75 net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION); | 74 net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION); |
76 | 75 |
77 if (IsEncryptionEstablished()) | 76 if (IsEncryptionEstablished()) |
78 RecordHandshakeState(STATE_ENCRYPTION_ESTABLISHED); | 77 RecordHandshakeState(STATE_ENCRYPTION_ESTABLISHED); |
79 if (IsCryptoHandshakeConfirmed()) | 78 if (IsCryptoHandshakeConfirmed()) |
80 RecordHandshakeState(STATE_HANDSHAKE_CONFIRMED); | 79 RecordHandshakeState(STATE_HANDSHAKE_CONFIRMED); |
81 else | 80 else |
82 RecordHandshakeState(STATE_FAILED); | 81 RecordHandshakeState(STATE_FAILED); |
83 | 82 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // use a weak pointer to be safe. | 232 // use a weak pointer to be safe. |
234 connection()->ProcessUdpPacket(local_address, peer_address, packet); | 233 connection()->ProcessUdpPacket(local_address, peer_address, packet); |
235 if (!connection()->connected()) { | 234 if (!connection()->connected()) { |
236 stream_factory_->OnSessionClose(this); | 235 stream_factory_->OnSessionClose(this); |
237 return; | 236 return; |
238 } | 237 } |
239 StartReading(); | 238 StartReading(); |
240 } | 239 } |
241 | 240 |
242 } // namespace net | 241 } // namespace net |
OLD | NEW |