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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 base::Value* QuicClientSession::GetInfoAsValue( | 495 base::Value* QuicClientSession::GetInfoAsValue( |
496 const std::set<HostPortProxyPair>& aliases) const { | 496 const std::set<HostPortProxyPair>& aliases) const { |
497 base::DictionaryValue* dict = new base::DictionaryValue(); | 497 base::DictionaryValue* dict = new base::DictionaryValue(); |
498 // TODO(rch): remove "host_port_pair" when Chrome 34 is stable. | 498 // TODO(rch): remove "host_port_pair" when Chrome 34 is stable. |
499 dict->SetString("host_port_pair", aliases.begin()->first.ToString()); | 499 dict->SetString("host_port_pair", aliases.begin()->first.ToString()); |
500 dict->SetString("version", QuicVersionToString(connection()->version())); | 500 dict->SetString("version", QuicVersionToString(connection()->version())); |
501 dict->SetInteger("open_streams", GetNumOpenStreams()); | 501 dict->SetInteger("open_streams", GetNumOpenStreams()); |
502 dict->SetInteger("total_streams", num_total_streams_); | 502 dict->SetInteger("total_streams", num_total_streams_); |
503 dict->SetString("peer_address", peer_address().ToString()); | 503 dict->SetString("peer_address", peer_address().ToString()); |
504 dict->SetString("guid", base::Uint64ToString(guid())); | 504 dict->SetString("connection_id", base::Uint64ToString(connection_id())); |
505 dict->SetBoolean("connected", connection()->connected()); | 505 dict->SetBoolean("connected", connection()->connected()); |
506 | 506 |
507 base::ListValue* alias_list = new base::ListValue(); | 507 base::ListValue* alias_list = new base::ListValue(); |
508 for (std::set<HostPortProxyPair>::const_iterator it = aliases.begin(); | 508 for (std::set<HostPortProxyPair>::const_iterator it = aliases.begin(); |
509 it != aliases.end(); it++) { | 509 it != aliases.end(); it++) { |
510 alias_list->Append(new base::StringValue(it->first.ToString())); | 510 alias_list->Append(new base::StringValue(it->first.ToString())); |
511 } | 511 } |
512 dict->Set("aliases", alias_list); | 512 dict->Set("aliases", alias_list); |
513 | 513 |
514 return dict; | 514 return dict; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 564 } |
565 | 565 |
566 void QuicClientSession::NotifyFactoryOfSessionClosed() { | 566 void QuicClientSession::NotifyFactoryOfSessionClosed() { |
567 DCHECK_EQ(0u, GetNumOpenStreams()); | 567 DCHECK_EQ(0u, GetNumOpenStreams()); |
568 // Will delete |this|. | 568 // Will delete |this|. |
569 if (stream_factory_) | 569 if (stream_factory_) |
570 stream_factory_->OnSessionClosed(this); | 570 stream_factory_->OnSessionClosed(this); |
571 } | 571 } |
572 | 572 |
573 } // namespace net | 573 } // namespace net |
OLD | NEW |