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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1940493002: Add Stats to Stun ping. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename. 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 | « webrtc/api/statstypes.cc ('k') | webrtc/p2p/base/port.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 error_ = best_connection_->GetError(); 1010 error_ = best_connection_->GetError();
1011 } 1011 }
1012 return sent; 1012 return sent;
1013 } 1013 }
1014 1014
1015 bool P2PTransportChannel::GetStats(ConnectionInfos *infos) { 1015 bool P2PTransportChannel::GetStats(ConnectionInfos *infos) {
1016 ASSERT(worker_thread_ == rtc::Thread::Current()); 1016 ASSERT(worker_thread_ == rtc::Thread::Current());
1017 // Gather connection infos. 1017 // Gather connection infos.
1018 infos->clear(); 1018 infos->clear();
1019 1019
1020 std::vector<Connection *>::const_iterator it;
1021 for (Connection* connection : connections_) { 1020 for (Connection* connection : connections_) {
1022 ConnectionInfo info; 1021 ConnectionInfo info = connection->stats();
1023 info.best_connection = (best_connection_ == connection); 1022 info.best_connection = (best_connection_ == connection);
1024 info.receiving = connection->receiving(); 1023 info.receiving = connection->receiving();
1025 info.writable = 1024 info.writable = (connection->write_state() == Connection::STATE_WRITABLE);
1026 (connection->write_state() == Connection::STATE_WRITABLE);
1027 info.timeout = 1025 info.timeout =
1028 (connection->write_state() == Connection::STATE_WRITE_TIMEOUT); 1026 (connection->write_state() == Connection::STATE_WRITE_TIMEOUT);
1029 info.new_connection = !connection->reported(); 1027 info.new_connection = !connection->reported();
1030 connection->set_reported(true); 1028 connection->set_reported(true);
1031 info.rtt = connection->rtt(); 1029 info.rtt = connection->rtt();
1032 info.sent_total_bytes = connection->sent_total_bytes();
1033 info.sent_bytes_second = connection->sent_bytes_second();
1034 info.sent_discarded_packets = connection->sent_discarded_packets();
1035 info.sent_total_packets = connection->sent_total_packets();
1036 info.recv_total_bytes = connection->recv_total_bytes();
1037 info.recv_bytes_second = connection->recv_bytes_second();
1038 info.local_candidate = connection->local_candidate(); 1030 info.local_candidate = connection->local_candidate();
1039 info.remote_candidate = connection->remote_candidate(); 1031 info.remote_candidate = connection->remote_candidate();
1040 info.key = connection; 1032 info.key = connection;
1041 infos->push_back(info); 1033 infos->push_back(info);
1042 } 1034 }
1043 1035
1044 return true; 1036 return true;
1045 } 1037 }
1046 1038
1047 rtc::DiffServCodePoint P2PTransportChannel::DefaultDscpValue() const { 1039 rtc::DiffServCodePoint P2PTransportChannel::DefaultDscpValue() const {
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 1687
1696 // During the initial state when nothing has been pinged yet, return the first 1688 // During the initial state when nothing has been pinged yet, return the first
1697 // one in the ordered |connections_|. 1689 // one in the ordered |connections_|.
1698 return *(std::find_if(connections_.begin(), connections_.end(), 1690 return *(std::find_if(connections_.begin(), connections_.end(),
1699 [conn1, conn2](Connection* conn) { 1691 [conn1, conn2](Connection* conn) {
1700 return conn == conn1 || conn == conn2; 1692 return conn == conn1 || conn == conn2;
1701 })); 1693 }));
1702 } 1694 }
1703 1695
1704 } // namespace cricket 1696 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/api/statstypes.cc ('k') | webrtc/p2p/base/port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698