| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 static_cast<QuicReliableClientStream*>(stream)->OnError(error); | 194 static_cast<QuicReliableClientStream*>(stream)->OnError(error); |
| 195 CloseStream(id); | 195 CloseStream(id); |
| 196 } | 196 } |
| 197 net_log_.BeginEvent( | 197 net_log_.BeginEvent( |
| 198 NetLog::TYPE_QUIC_SESSION, | 198 NetLog::TYPE_QUIC_SESSION, |
| 199 NetLog::IntegerCallback("net_error", error)); | 199 NetLog::IntegerCallback("net_error", error)); |
| 200 // Will delete |this|. | 200 // Will delete |this|. |
| 201 stream_factory_->OnSessionClose(this); | 201 stream_factory_->OnSessionClose(this); |
| 202 } | 202 } |
| 203 | 203 |
| 204 Value* QuicClientSession::GetInfoAsValue(const HostPortPair& pair) const { | 204 base::Value* QuicClientSession::GetInfoAsValue(const HostPortPair& pair) const { |
| 205 DictionaryValue* dict = new DictionaryValue(); | 205 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 206 dict->SetString("host_port_pair", pair.ToString()); | 206 dict->SetString("host_port_pair", pair.ToString()); |
| 207 dict->SetInteger("open_streams", GetNumOpenStreams()); | 207 dict->SetInteger("open_streams", GetNumOpenStreams()); |
| 208 dict->SetInteger("total_streams", num_total_streams_); | 208 dict->SetInteger("total_streams", num_total_streams_); |
| 209 dict->SetString("peer_address", peer_address().ToString()); | 209 dict->SetString("peer_address", peer_address().ToString()); |
| 210 dict->SetString("guid", base::Uint64ToString(guid())); | 210 dict->SetString("guid", base::Uint64ToString(guid())); |
| 211 return dict; | 211 return dict; |
| 212 } | 212 } |
| 213 | 213 |
| 214 void QuicClientSession::OnReadComplete(int result) { | 214 void QuicClientSession::OnReadComplete(int result) { |
| 215 read_pending_ = false; | 215 read_pending_ = false; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 233 // use a weak pointer to be safe. | 233 // use a weak pointer to be safe. |
| 234 connection()->ProcessUdpPacket(local_address, peer_address, packet); | 234 connection()->ProcessUdpPacket(local_address, peer_address, packet); |
| 235 if (!connection()->connected()) { | 235 if (!connection()->connected()) { |
| 236 stream_factory_->OnSessionClose(this); | 236 stream_factory_->OnSessionClose(this); |
| 237 return; | 237 return; |
| 238 } | 238 } |
| 239 StartReading(); | 239 StartReading(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace net | 242 } // namespace net |
| OLD | NEW |