Move RTCOutboundRTPStreamStats.roundTripTime to inbound, don't collect.

The value is being moved:
https://github.com/w3c/webrtc-stats/pull/167

Stop collecting this value. Our previous value was incorrect, our RTT
value was a smoothed value based on STUN pings but the spec says it
should be based on RTCP timestamps in RTCP Receiver Report (RR) on
inbound streams with isRemote=true (not supported).

Updated some bug references.

BUG=webrtc:7065, webrtc:7066

Review-Url: https://codereview.webrtc.org/2722633005
Cr-Commit-Position: refs/heads/master@{#16931}
diff --git a/webrtc/api/stats/rtcstats_objects.h b/webrtc/api/stats/rtcstats_objects.h
index cc01b5e..49135f8 100644
--- a/webrtc/api/stats/rtcstats_objects.h
+++ b/webrtc/api/stats/rtcstats_objects.h
@@ -327,8 +327,8 @@
 };
 
 // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
-// Tracking bug crbug.com/657855
-// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855
+// TODO(hbos): Support the remote case |is_remote = true|.
+// https://bugs.webrtc.org/7065
 class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
  public:
   WEBRTC_RTCSTATS_DECL();
@@ -341,36 +341,38 @@
   RTCStatsMember<uint32_t> packets_received;
   RTCStatsMember<uint64_t> bytes_received;
   RTCStatsMember<uint32_t> packets_lost;
-  // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|.
-  // crbug.com/657855
+  // TODO(hbos): Collect and populate this value for both "audio" and "video",
+  // currently not collected for "video". https://bugs.webrtc.org/7065
   RTCStatsMember<double> jitter;
   RTCStatsMember<double> fraction_lost;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
+  RTCStatsMember<double> round_trip_time;
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> packets_discarded;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> packets_repaired;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> burst_packets_lost;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> burst_packets_discarded;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> burst_loss_count;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<uint32_t> burst_discard_count;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<double> burst_loss_rate;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<double> burst_discard_rate;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<double> gap_loss_rate;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
   RTCStatsMember<double> gap_discard_rate;
   RTCStatsMember<uint32_t> frames_decoded;
 };
 
 // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
-// Tracking bug crbug.com/657856
-// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856
+// TODO(hbos): Support the remote case |is_remote = true|.
+// https://bugs.webrtc.org/7066
 class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
  public:
   WEBRTC_RTCSTATS_DECL();
@@ -382,9 +384,8 @@
 
   RTCStatsMember<uint32_t> packets_sent;
   RTCStatsMember<uint64_t> bytes_sent;
-  // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856
+  // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7066
   RTCStatsMember<double> target_bitrate;
-  RTCStatsMember<double> round_trip_time;
   RTCStatsMember<uint32_t> frames_encoded;
 };
 
diff --git a/webrtc/pc/rtcstats_integrationtest.cc b/webrtc/pc/rtcstats_integrationtest.cc
index 1176b54..922e07c 100644
--- a/webrtc/pc/rtcstats_integrationtest.cc
+++ b/webrtc/pc/rtcstats_integrationtest.cc
@@ -553,6 +553,7 @@
       verifier.TestMemberIsNonNegative<double>(inbound_stream.jitter);
     }
     verifier.TestMemberIsNonNegative<double>(inbound_stream.fraction_lost);
+    verifier.TestMemberIsUndefined(inbound_stream.round_trip_time);
     verifier.TestMemberIsUndefined(inbound_stream.packets_discarded);
     verifier.TestMemberIsUndefined(inbound_stream.packets_repaired);
     verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost);
@@ -585,8 +586,6 @@
     verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.packets_sent);
     verifier.TestMemberIsNonNegative<uint64_t>(outbound_stream.bytes_sent);
     verifier.TestMemberIsUndefined(outbound_stream.target_bitrate);
-    // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877
-    verifier.MarkMemberTested(outbound_stream.round_trip_time, true);
     if (outbound_stream.media_type.is_defined() &&
         *outbound_stream.media_type == "video") {
       verifier.TestMemberIsDefined(outbound_stream.frames_encoded);
diff --git a/webrtc/pc/rtcstatscollector.cc b/webrtc/pc/rtcstatscollector.cc
index 36a4bde..347bca5 100644
--- a/webrtc/pc/rtcstatscollector.cc
+++ b/webrtc/pc/rtcstatscollector.cc
@@ -261,10 +261,6 @@
       static_cast<uint32_t>(media_sender_info.packets_sent);
   outbound_stats->bytes_sent =
       static_cast<uint64_t>(media_sender_info.bytes_sent);
-  if (media_sender_info.rtt_ms >= 0) {
-    outbound_stats->round_trip_time = static_cast<double>(
-        media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec;
-  }
 }
 
 void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
diff --git a/webrtc/pc/rtcstatscollector_unittest.cc b/webrtc/pc/rtcstatscollector_unittest.cc
index db26096..ea7b34a 100644
--- a/webrtc/pc/rtcstatscollector_unittest.cc
+++ b/webrtc/pc/rtcstatscollector_unittest.cc
@@ -1959,7 +1959,6 @@
   voice_media_info.senders[0].local_stats[0].ssrc = 1;
   voice_media_info.senders[0].packets_sent = 2;
   voice_media_info.senders[0].bytes_sent = 3;
-  voice_media_info.senders[0].rtt_ms = -1;
   voice_media_info.senders[0].codec_payload_type = rtc::Optional<int>(42);
 
   RtpCodecParameters codec_parameters;
@@ -2005,22 +2004,12 @@
   expected_audio.codec_id = "RTCCodec_OutboundAudio_42";
   expected_audio.packets_sent = 2;
   expected_audio.bytes_sent = 3;
-  // |expected_audio.round_trip_time| should be undefined.
 
   ASSERT_TRUE(report->Get(expected_audio.id()));
   EXPECT_EQ(
       report->Get(expected_audio.id())->cast_to<RTCOutboundRTPStreamStats>(),
       expected_audio);
 
-  // Set previously undefined values and "GetStats" again.
-  voice_media_info.senders[0].rtt_ms = 4500;
-  expected_audio.round_trip_time = 4.5;
-
-  EXPECT_CALL(*voice_media_channel, GetStats(_))
-      .WillOnce(DoAll(SetArgPointee<0>(voice_media_info), Return(true)));
-  collector_->ClearCachedStatsReport();
-  report = GetStatsReport();
-
   ASSERT_TRUE(report->Get(expected_audio.id()));
   EXPECT_EQ(
       report->Get(expected_audio.id())->cast_to<RTCOutboundRTPStreamStats>(),
@@ -2050,7 +2039,6 @@
   video_media_info.senders[0].nacks_rcvd = 4;
   video_media_info.senders[0].packets_sent = 5;
   video_media_info.senders[0].bytes_sent = 6;
-  video_media_info.senders[0].rtt_ms = -1;
   video_media_info.senders[0].codec_payload_type = rtc::Optional<int>(42);
   video_media_info.senders[0].frames_encoded = 8;
   video_media_info.senders[0].qp_sum = rtc::Optional<uint64_t>();
@@ -2102,8 +2090,7 @@
   expected_video.packets_sent = 5;
   expected_video.bytes_sent = 6;
   expected_video.frames_encoded = 8;
-  // |expected_video.round_trip_time| and |expected_video.qp_sum| should be
-  // undefined.
+  // |expected_video.qp_sum| should be undefined.
 
   ASSERT_TRUE(report->Get(expected_video.id()));
   EXPECT_EQ(
@@ -2111,9 +2098,7 @@
       expected_video);
 
   // Set previously undefined values and "GetStats" again.
-  video_media_info.senders[0].rtt_ms = 7500;
   video_media_info.senders[0].qp_sum = rtc::Optional<uint64_t>(9);
-  expected_video.round_trip_time = 7.5;
   expected_video.qp_sum = 9;
 
   EXPECT_CALL(*video_media_channel, GetStats(_))
diff --git a/webrtc/stats/rtcstats_objects.cc b/webrtc/stats/rtcstats_objects.cc
index 9a7ebed..5397ef7 100644
--- a/webrtc/stats/rtcstats_objects.cc
+++ b/webrtc/stats/rtcstats_objects.cc
@@ -513,6 +513,7 @@
     &packets_lost,
     &jitter,
     &fraction_lost,
+    &round_trip_time,
     &packets_discarded,
     &packets_repaired,
     &burst_packets_lost,
@@ -538,6 +539,7 @@
       packets_lost("packetsLost"),
       jitter("jitter"),
       fraction_lost("fractionLost"),
+      round_trip_time("roundTripTime"),
       packets_discarded("packetsDiscarded"),
       packets_repaired("packetsRepaired"),
       burst_packets_lost("burstPacketsLost"),
@@ -559,6 +561,7 @@
       packets_lost(other.packets_lost),
       jitter(other.jitter),
       fraction_lost(other.fraction_lost),
+      round_trip_time(other.round_trip_time),
       packets_discarded(other.packets_discarded),
       packets_repaired(other.packets_repaired),
       burst_packets_lost(other.burst_packets_lost),
@@ -580,7 +583,6 @@
     &packets_sent,
     &bytes_sent,
     &target_bitrate,
-    &round_trip_time,
     &frames_encoded);
 
 RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
@@ -594,7 +596,6 @@
       packets_sent("packetsSent"),
       bytes_sent("bytesSent"),
       target_bitrate("targetBitrate"),
-      round_trip_time("roundTripTime"),
       frames_encoded("framesEncoded") {
 }
 
@@ -604,7 +605,6 @@
       packets_sent(other.packets_sent),
       bytes_sent(other.bytes_sent),
       target_bitrate(other.target_bitrate),
-      round_trip_time(other.round_trip_time),
       frames_encoded(other.frames_encoded) {
 }