Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: net/quic/quic_chromium_client_session.cc

Issue 2037933002: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/quic/quic_connection_logger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_chromium_client_session.h" 5 #include "net/quic/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1030 }
1031 1031
1032 std::unique_ptr<base::Value> QuicChromiumClientSession::GetInfoAsValue( 1032 std::unique_ptr<base::Value> QuicChromiumClientSession::GetInfoAsValue(
1033 const std::set<HostPortPair>& aliases) { 1033 const std::set<HostPortPair>& aliases) {
1034 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 1034 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
1035 dict->SetString("version", QuicVersionToString(connection()->version())); 1035 dict->SetString("version", QuicVersionToString(connection()->version()));
1036 dict->SetInteger("open_streams", GetNumOpenOutgoingStreams()); 1036 dict->SetInteger("open_streams", GetNumOpenOutgoingStreams());
1037 std::unique_ptr<base::ListValue> stream_list(new base::ListValue()); 1037 std::unique_ptr<base::ListValue> stream_list(new base::ListValue());
1038 for (StreamMap::const_iterator it = dynamic_streams().begin(); 1038 for (StreamMap::const_iterator it = dynamic_streams().begin();
1039 it != dynamic_streams().end(); ++it) { 1039 it != dynamic_streams().end(); ++it) {
1040 stream_list->Append( 1040 stream_list->AppendString(base::UintToString(it->second->id()));
1041 new base::StringValue(base::UintToString(it->second->id())));
1042 } 1041 }
1043 dict->Set("active_streams", std::move(stream_list)); 1042 dict->Set("active_streams", std::move(stream_list));
1044 1043
1045 dict->SetInteger("total_streams", num_total_streams_); 1044 dict->SetInteger("total_streams", num_total_streams_);
1046 dict->SetString("peer_address", peer_address().ToString()); 1045 dict->SetString("peer_address", peer_address().ToString());
1047 dict->SetString("connection_id", base::Uint64ToString(connection_id())); 1046 dict->SetString("connection_id", base::Uint64ToString(connection_id()));
1048 dict->SetBoolean("connected", connection()->connected()); 1047 dict->SetBoolean("connected", connection()->connected());
1049 const QuicConnectionStats& stats = connection()->GetStats(); 1048 const QuicConnectionStats& stats = connection()->GetStats();
1050 dict->SetInteger("packets_sent", stats.packets_sent); 1049 dict->SetInteger("packets_sent", stats.packets_sent);
1051 dict->SetInteger("packets_received", stats.packets_received); 1050 dict->SetInteger("packets_received", stats.packets_received);
1052 dict->SetInteger("packets_lost", stats.packets_lost); 1051 dict->SetInteger("packets_lost", stats.packets_lost);
1053 SSLInfo ssl_info; 1052 SSLInfo ssl_info;
1054 dict->SetBoolean("secure", GetSSLInfo(&ssl_info) && ssl_info.cert.get()); 1053 dict->SetBoolean("secure", GetSSLInfo(&ssl_info) && ssl_info.cert.get());
1055 1054
1056 std::unique_ptr<base::ListValue> alias_list(new base::ListValue()); 1055 std::unique_ptr<base::ListValue> alias_list(new base::ListValue());
1057 for (std::set<HostPortPair>::const_iterator it = aliases.begin(); 1056 for (std::set<HostPortPair>::const_iterator it = aliases.begin();
1058 it != aliases.end(); it++) { 1057 it != aliases.end(); it++) {
1059 alias_list->Append(new base::StringValue(it->ToString())); 1058 alias_list->AppendString(it->ToString());
1060 } 1059 }
1061 dict->Set("aliases", std::move(alias_list)); 1060 dict->Set("aliases", std::move(alias_list));
1062 1061
1063 return std::move(dict); 1062 return std::move(dict);
1064 } 1063 }
1065 1064
1066 base::WeakPtr<QuicChromiumClientSession> 1065 base::WeakPtr<QuicChromiumClientSession>
1067 QuicChromiumClientSession::GetWeakPtr() { 1066 QuicChromiumClientSession::GetWeakPtr() {
1068 return weak_factory_.GetWeakPtr(); 1067 return weak_factory_.GetWeakPtr();
1069 } 1068 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 } 1198 }
1200 1199
1201 void QuicChromiumClientSession::DeletePromised( 1200 void QuicChromiumClientSession::DeletePromised(
1202 QuicClientPromisedInfo* promised) { 1201 QuicClientPromisedInfo* promised) {
1203 if (IsOpenStream(promised->id())) 1202 if (IsOpenStream(promised->id()))
1204 streams_pushed_and_claimed_count_++; 1203 streams_pushed_and_claimed_count_++;
1205 QuicClientSessionBase::DeletePromised(promised); 1204 QuicClientSessionBase::DeletePromised(promised);
1206 } 1205 }
1207 1206
1208 } // namespace net 1207 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/quic/quic_connection_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698