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

Side by Side Diff: webrtc/pc/rtcstatscollector.cc

Issue 2719523002: RTCIceCandidatePairStats.[total/current]RoundTripTime collected. (Closed)
Patch Set: EXPECT_EQ(expected, actual) Created 3 years, 9 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/pc/rtcstats_integrationtest.cc ('k') | webrtc/pc/rtcstatscollector_unittest.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 /* 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 candidate_pair_stats->priority = info.priority; 868 candidate_pair_stats->priority = info.priority;
869 candidate_pair_stats->nominated = info.nominated; 869 candidate_pair_stats->nominated = info.nominated;
870 // TODO(hbos): This writable is different than the spec. It goes to 870 // TODO(hbos): This writable is different than the spec. It goes to
871 // false after a certain amount of time without a response passes. 871 // false after a certain amount of time without a response passes.
872 // crbug.com/633550 872 // crbug.com/633550
873 candidate_pair_stats->writable = info.writable; 873 candidate_pair_stats->writable = info.writable;
874 candidate_pair_stats->bytes_sent = 874 candidate_pair_stats->bytes_sent =
875 static_cast<uint64_t>(info.sent_total_bytes); 875 static_cast<uint64_t>(info.sent_total_bytes);
876 candidate_pair_stats->bytes_received = 876 candidate_pair_stats->bytes_received =
877 static_cast<uint64_t>(info.recv_total_bytes); 877 static_cast<uint64_t>(info.recv_total_bytes);
878 // TODO(hbos): The |info.rtt| measurement is smoothed. It shouldn't be 878 candidate_pair_stats->total_round_trip_time =
879 // smoothed according to the spec. crbug.com/633550. See 879 static_cast<double>(info.total_round_trip_time_ms) /
880 // https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-curr entrtt 880 rtc::kNumMillisecsPerSec;
881 candidate_pair_stats->current_round_trip_time = 881 if (info.current_round_trip_time_ms) {
882 static_cast<double>(info.rtt) / rtc::kNumMillisecsPerSec; 882 candidate_pair_stats->current_round_trip_time =
883 static_cast<double>(*info.current_round_trip_time_ms) /
884 rtc::kNumMillisecsPerSec;
885 }
883 if (info.best_connection && video_media_info && 886 if (info.best_connection && video_media_info &&
884 !video_media_info->bw_estimations.empty()) { 887 !video_media_info->bw_estimations.empty()) {
885 // The bandwidth estimations we have are for the selected candidate 888 // The bandwidth estimations we have are for the selected candidate
886 // pair ("info.best_connection"). 889 // pair ("info.best_connection").
887 RTC_DCHECK_EQ(video_media_info->bw_estimations.size(), 1); 890 RTC_DCHECK_EQ(video_media_info->bw_estimations.size(), 1);
888 RTC_DCHECK_GE( 891 RTC_DCHECK_GE(
889 video_media_info->bw_estimations[0].available_send_bandwidth, 0); 892 video_media_info->bw_estimations[0].available_send_bandwidth, 0);
890 RTC_DCHECK_GE( 893 RTC_DCHECK_GE(
891 video_media_info->bw_estimations[0].available_recv_bandwidth, 0); 894 video_media_info->bw_estimations[0].available_recv_bandwidth, 0);
892 if (video_media_info->bw_estimations[0].available_send_bandwidth) { 895 if (video_media_info->bw_estimations[0].available_send_bandwidth) {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 const std::string& type) { 1250 const std::string& type) {
1248 return CandidateTypeToRTCIceCandidateType(type); 1251 return CandidateTypeToRTCIceCandidateType(type);
1249 } 1252 }
1250 1253
1251 const char* DataStateToRTCDataChannelStateForTesting( 1254 const char* DataStateToRTCDataChannelStateForTesting(
1252 DataChannelInterface::DataState state) { 1255 DataChannelInterface::DataState state) {
1253 return DataStateToRTCDataChannelState(state); 1256 return DataStateToRTCDataChannelState(state);
1254 } 1257 }
1255 1258
1256 } // namespace webrtc 1259 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/rtcstats_integrationtest.cc ('k') | webrtc/pc/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698