Commit 3843c097 authored by rch@chromium.org's avatar rch@chromium.org

Improve the content displayed at chrome://net-internals/#quic

* Display the connection id correctly
* Display the number of packets sent, lost, and received
* Display the set of active stream ids

Review URL: https://codereview.chromium.org/293763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271539 0039d316-1c4b-4281-b951-d872f2087c98
parent 9ff020cf
...@@ -21,9 +21,13 @@ ...@@ -21,9 +21,13 @@
<th>Secure</th> <th>Secure</th>
<th>Version</th> <th>Version</th>
<th>Peer address</th> <th>Peer address</th>
<th>GUID</th> <th>Connection UID</th>
<th>Active stream count</th>
<th>Active streams</th> <th>Active streams</th>
<th>Total streams</th> <th>Total stream count</th>
<th>Packets Sent</th>
<th>Packets Lost</th>
<th>Packets Received</th>
<th>Connected</th> <th>Connected</th>
</tr> </tr>
</thead> </thead>
...@@ -33,9 +37,13 @@ ...@@ -33,9 +37,13 @@
<td jscontent="!!secure"></td> <td jscontent="!!secure"></td>
<td jscontent="version"></td> <td jscontent="version"></td>
<td jscontent="peer_address"></td> <td jscontent="peer_address"></td>
<td jscontent="guid"></td> <td jscontent="connection_id"></td>
<td jscontent="open_streams"></td> <td jscontent="open_streams"></td>
<td jscontent="$this.active_streams && $this.active_streams.length > 0 ? $this.active_streams.join(', ') : 'None'"></td>
<td jscontent="total_streams"></td> <td jscontent="total_streams"></td>
<td jscontent="packets_sent"></td>
<td jscontent="packets_lost"></td>
<td jscontent="packets_received"></td>
<td jscontent="connected"></td> <td jscontent="connected"></td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -668,16 +668,30 @@ void QuicClientSession::CloseAllObservers(int net_error) { ...@@ -668,16 +668,30 @@ void QuicClientSession::CloseAllObservers(int net_error) {
} }
base::Value* QuicClientSession::GetInfoAsValue( base::Value* QuicClientSession::GetInfoAsValue(
const std::set<HostPortPair>& aliases) const { const std::set<HostPortPair>& aliases) {
base::DictionaryValue* dict = new base::DictionaryValue(); base::DictionaryValue* dict = new base::DictionaryValue();
// TODO(rch): remove "host_port_pair" when Chrome 34 is stable. // TODO(rch): remove "host_port_pair" when Chrome 34 is stable.
dict->SetString("host_port_pair", aliases.begin()->ToString()); dict->SetString("host_port_pair", aliases.begin()->ToString());
dict->SetString("version", QuicVersionToString(connection()->version())); dict->SetString("version", QuicVersionToString(connection()->version()));
dict->SetInteger("open_streams", GetNumOpenStreams()); dict->SetInteger("open_streams", GetNumOpenStreams());
base::ListValue* stream_list = new base::ListValue();
for (base::hash_map<QuicStreamId, QuicDataStream*>::const_iterator it
= streams()->begin();
it != streams()->end();
++it) {
stream_list->Append(new base::StringValue(
base::Uint64ToString(it->second->id())));
}
dict->Set("active_streams", stream_list);
dict->SetInteger("total_streams", num_total_streams_); dict->SetInteger("total_streams", num_total_streams_);
dict->SetString("peer_address", peer_address().ToString()); dict->SetString("peer_address", peer_address().ToString());
dict->SetString("connection_id", base::Uint64ToString(connection_id())); dict->SetString("connection_id", base::Uint64ToString(connection_id()));
dict->SetBoolean("connected", connection()->connected()); dict->SetBoolean("connected", connection()->connected());
const QuicConnectionStats& stats = connection()->GetStats();
dict->SetInteger("packets_sent", stats.packets_sent);
dict->SetInteger("packets_received", stats.packets_received);
dict->SetInteger("packets_lost", stats.packets_lost);
SSLInfo ssl_info; SSLInfo ssl_info;
dict->SetBoolean("secure", GetSSLInfo(&ssl_info) && ssl_info.cert); dict->SetBoolean("secure", GetSSLInfo(&ssl_info) && ssl_info.cert);
......
...@@ -158,7 +158,7 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase { ...@@ -158,7 +158,7 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase {
// that this session has been closed, which will delete the session. // that this session has been closed, which will delete the session.
void CloseSessionOnError(int error); void CloseSessionOnError(int error);
base::Value* GetInfoAsValue(const std::set<HostPortPair>& aliases) const; base::Value* GetInfoAsValue(const std::set<HostPortPair>& aliases);
const BoundNetLog& net_log() const { return net_log_; } const BoundNetLog& net_log() const { return net_log_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment