| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 IceCandidatePairStateToRTCStatsIceCandidatePairState(info.state); | 867 IceCandidatePairStateToRTCStatsIceCandidatePairState(info.state); |
| 868 candidate_pair_stats->priority = info.priority; | 868 candidate_pair_stats->priority = info.priority; |
| 869 // TODO(hbos): This writable is different than the spec. It goes to | 869 // TODO(hbos): This writable is different than the spec. It goes to |
| 870 // false after a certain amount of time without a response passes. | 870 // false after a certain amount of time without a response passes. |
| 871 // crbug.com/633550 | 871 // crbug.com/633550 |
| 872 candidate_pair_stats->writable = info.writable; | 872 candidate_pair_stats->writable = info.writable; |
| 873 candidate_pair_stats->bytes_sent = | 873 candidate_pair_stats->bytes_sent = |
| 874 static_cast<uint64_t>(info.sent_total_bytes); | 874 static_cast<uint64_t>(info.sent_total_bytes); |
| 875 candidate_pair_stats->bytes_received = | 875 candidate_pair_stats->bytes_received = |
| 876 static_cast<uint64_t>(info.recv_total_bytes); | 876 static_cast<uint64_t>(info.recv_total_bytes); |
| 877 // TODO(hbos): The |info.rtt| measurement is smoothed. It shouldn't be | 877 if (info.total_round_trip_time_ms) { |
| 878 // smoothed according to the spec. crbug.com/633550. See | 878 candidate_pair_stats->total_round_trip_time = |
| 879 // https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-curr
entrtt | 879 static_cast<double>(*info.total_round_trip_time_ms) / |
| 880 candidate_pair_stats->current_round_trip_time = | 880 rtc::kNumMillisecsPerSec; |
| 881 static_cast<double>(info.rtt) / rtc::kNumMillisecsPerSec; | 881 } |
| 882 if (info.current_round_trip_time_ms) { |
| 883 candidate_pair_stats->current_round_trip_time = |
| 884 static_cast<double>(*info.current_round_trip_time_ms) / |
| 885 rtc::kNumMillisecsPerSec; |
| 886 } |
| 882 if (info.best_connection && video_media_info && | 887 if (info.best_connection && video_media_info && |
| 883 !video_media_info->bw_estimations.empty()) { | 888 !video_media_info->bw_estimations.empty()) { |
| 884 // The bandwidth estimations we have are for the selected candidate | 889 // The bandwidth estimations we have are for the selected candidate |
| 885 // pair ("info.best_connection"). | 890 // pair ("info.best_connection"). |
| 886 RTC_DCHECK_EQ(video_media_info->bw_estimations.size(), 1); | 891 RTC_DCHECK_EQ(video_media_info->bw_estimations.size(), 1); |
| 887 RTC_DCHECK_GE( | 892 RTC_DCHECK_GE( |
| 888 video_media_info->bw_estimations[0].available_send_bandwidth, 0); | 893 video_media_info->bw_estimations[0].available_send_bandwidth, 0); |
| 889 RTC_DCHECK_GE( | 894 RTC_DCHECK_GE( |
| 890 video_media_info->bw_estimations[0].available_recv_bandwidth, 0); | 895 video_media_info->bw_estimations[0].available_recv_bandwidth, 0); |
| 891 if (video_media_info->bw_estimations[0].available_send_bandwidth) { | 896 if (video_media_info->bw_estimations[0].available_send_bandwidth) { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 const std::string& type) { | 1251 const std::string& type) { |
| 1247 return CandidateTypeToRTCIceCandidateType(type); | 1252 return CandidateTypeToRTCIceCandidateType(type); |
| 1248 } | 1253 } |
| 1249 | 1254 |
| 1250 const char* DataStateToRTCDataChannelStateForTesting( | 1255 const char* DataStateToRTCDataChannelStateForTesting( |
| 1251 DataChannelInterface::DataState state) { | 1256 DataChannelInterface::DataState state) { |
| 1252 return DataStateToRTCDataChannelState(state); | 1257 return DataStateToRTCDataChannelState(state); |
| 1253 } | 1258 } |
| 1254 | 1259 |
| 1255 } // namespace webrtc | 1260 } // namespace webrtc |
| OLD | NEW |