Clean up last_packet_received_time_ as it's no longer used.

Bug: webrtc:15377
Change-Id: I5453b9fd572a04dbea3241a2eb1c8ad8bb8b1186
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320560
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40792}
diff --git a/api/transport/network_control.h b/api/transport/network_control.h
index 8623224..c07447c 100644
--- a/api/transport/network_control.h
+++ b/api/transport/network_control.h
@@ -79,9 +79,6 @@
   // Called when a packet is sent on the network.
   ABSL_MUST_USE_RESULT virtual NetworkControlUpdate OnSentPacket(
       SentPacket) = 0;
-  // Called when a packet is received from the remote client.
-  ABSL_MUST_USE_RESULT virtual NetworkControlUpdate OnReceivedPacket(
-      ReceivedPacket) = 0;
   // Called when the stream specific configuration has been updated.
   ABSL_MUST_USE_RESULT virtual NetworkControlUpdate OnStreamsConfig(
       StreamsConfig) = 0;
diff --git a/api/transport/test/mock_network_control.h b/api/transport/test/mock_network_control.h
index e3a15b8..841628d 100644
--- a/api/transport/test/mock_network_control.h
+++ b/api/transport/test/mock_network_control.h
@@ -40,10 +40,6 @@
               (override));
   MOCK_METHOD(NetworkControlUpdate, OnSentPacket, (SentPacket), (override));
   MOCK_METHOD(NetworkControlUpdate,
-              OnReceivedPacket,
-              (ReceivedPacket),
-              (override));
-  MOCK_METHOD(NetworkControlUpdate,
               OnStreamsConfig,
               (StreamsConfig),
               (override));
diff --git a/call/call.cc b/call/call.cc
index fa5d14d..9b605e4 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -1460,7 +1460,6 @@
   if (packet.GetExtension<AbsoluteSendTime>(&time_24)) {
     packet_msg.send_time = AbsoluteSendTime::ToTimestamp(time_24);
   }
-  transport_send_->OnReceivedPacket(packet_msg);
 
   receive_side_cc_.OnReceivedPacket(packet, media_type);
 }
diff --git a/call/rtp_transport_controller_send.cc b/call/rtp_transport_controller_send.cc
index dc1d371..77d334b 100644
--- a/call/rtp_transport_controller_send.cc
+++ b/call/rtp_transport_controller_send.cc
@@ -419,13 +419,6 @@
   }
 }
 
-void RtpTransportControllerSend::OnReceivedPacket(
-    const ReceivedPacket& packet_msg) {
-  RTC_DCHECK_RUN_ON(&sequence_checker_);
-  if (controller_)
-    PostUpdates(controller_->OnReceivedPacket(packet_msg));
-}
-
 void RtpTransportControllerSend::UpdateBitrateConstraints(
     const BitrateConstraints& updated) {
   RTC_DCHECK_RUN_ON(&sequence_checker_);
diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h
index 1aace1c..42f4f77 100644
--- a/call/rtp_transport_controller_send.h
+++ b/call/rtp_transport_controller_send.h
@@ -96,7 +96,6 @@
   absl::optional<Timestamp> GetFirstPacketTime() const override;
   void EnablePeriodicAlrProbing(bool enable) override;
   void OnSentPacket(const rtc::SentPacket& sent_packet) override;
-  void OnReceivedPacket(const ReceivedPacket& packet_msg) override;
 
   void SetSdpBitrateParameters(const BitrateConstraints& constraints) override;
   void SetClientBitratePreferences(const BitrateSettings& preferences) override;
diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h
index 7edc135..a63189f 100644
--- a/call/rtp_transport_controller_send_interface.h
+++ b/call/rtp_transport_controller_send_interface.h
@@ -32,7 +32,6 @@
 #include "modules/rtp_rtcp/include/rtcp_statistics.h"
 #include "modules/rtp_rtcp/include/rtp_packet_sender.h"
 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
-#include "modules/rtp_rtcp/source/rtp_packet_received.h"
 
 namespace rtc {
 struct SentPacket;
@@ -139,8 +138,6 @@
   // the calling thread or make assumptions about the thread context.
   virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
 
-  virtual void OnReceivedPacket(const ReceivedPacket& received_packet) = 0;
-
   virtual void SetSdpBitrateParameters(
       const BitrateConstraints& constraints) = 0;
   virtual void SetClientBitratePreferences(
diff --git a/call/test/mock_rtp_transport_controller_send.h b/call/test/mock_rtp_transport_controller_send.h
index b24e5a5..366db42 100644
--- a/call/test/mock_rtp_transport_controller_send.h
+++ b/call/test/mock_rtp_transport_controller_send.h
@@ -98,7 +98,6 @@
   MOCK_METHOD(void, OnTransportOverheadChanged, (size_t), (override));
   MOCK_METHOD(void, AccountForAudioPacketsInPacedSender, (bool), (override));
   MOCK_METHOD(void, IncludeOverheadInPacedSender, (), (override));
-  MOCK_METHOD(void, OnReceivedPacket, (const ReceivedPacket&), (override));
   MOCK_METHOD(void, EnsureStarted, (), (override));
 };
 }  // namespace webrtc
diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
index 9d7828d..4cbd40a 100644
--- a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
+++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
@@ -240,7 +240,7 @@
                                       probes.begin(), probes.end());
 
   if (rate_control_settings_.UseCongestionWindow() &&
-      last_packet_received_time_.IsFinite() && !feedback_max_rtts_.empty()) {
+      !feedback_max_rtts_.empty()) {
     UpdateCongestionWindowSize();
   }
   if (congestion_window_pushback_controller_ && current_data_window_) {
@@ -304,12 +304,6 @@
   }
 }
 
-NetworkControlUpdate GoogCcNetworkController::OnReceivedPacket(
-    ReceivedPacket received_packet) {
-  last_packet_received_time_ = received_packet.receive_time;
-  return NetworkControlUpdate();
-}
-
 NetworkControlUpdate GoogCcNetworkController::OnStreamsConfig(
     StreamsConfig msg) {
   NetworkControlUpdate update;
diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.h b/modules/congestion_controller/goog_cc/goog_cc_network_control.h
index df918e1..a524beb 100644
--- a/modules/congestion_controller/goog_cc/goog_cc_network_control.h
+++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.h
@@ -63,7 +63,6 @@
   NetworkControlUpdate OnRemoteBitrateReport(RemoteBitrateReport msg) override;
   NetworkControlUpdate OnRoundTripTimeUpdate(RoundTripTimeUpdate msg) override;
   NetworkControlUpdate OnSentPacket(SentPacket msg) override;
-  NetworkControlUpdate OnReceivedPacket(ReceivedPacket msg) override;
   NetworkControlUpdate OnStreamsConfig(StreamsConfig msg) override;
   NetworkControlUpdate OnTargetRateConstraints(
       TargetRateConstraints msg) override;
@@ -133,7 +132,6 @@
 
   absl::optional<uint8_t> last_estimated_fraction_loss_ = 0;
   TimeDelta last_estimated_round_trip_time_ = TimeDelta::PlusInfinity();
-  Timestamp last_packet_received_time_ = Timestamp::MinusInfinity();
 
   double pacing_factor_;
   DataRate min_total_allocated_bitrate_;
diff --git a/modules/congestion_controller/pcc/pcc_network_controller.cc b/modules/congestion_controller/pcc/pcc_network_controller.cc
index 8653470..116bd1a 100644
--- a/modules/congestion_controller/pcc/pcc_network_controller.cc
+++ b/modules/congestion_controller/pcc/pcc_network_controller.cc
@@ -377,11 +377,6 @@
   return NetworkControlUpdate();
 }
 
-NetworkControlUpdate PccNetworkController::OnReceivedPacket(
-    ReceivedPacket msg) {
-  return NetworkControlUpdate();
-}
-
 NetworkControlUpdate PccNetworkController::OnNetworkStateEstimate(
     NetworkStateEstimate msg) {
   return NetworkControlUpdate();
diff --git a/modules/congestion_controller/pcc/pcc_network_controller.h b/modules/congestion_controller/pcc/pcc_network_controller.h
index e5f65dd..37bb0ab 100644
--- a/modules/congestion_controller/pcc/pcc_network_controller.h
+++ b/modules/congestion_controller/pcc/pcc_network_controller.h
@@ -78,7 +78,6 @@
   NetworkControlUpdate OnRemoteBitrateReport(RemoteBitrateReport msg) override;
   NetworkControlUpdate OnRoundTripTimeUpdate(RoundTripTimeUpdate msg) override;
   NetworkControlUpdate OnTransportLossReport(TransportLossReport msg) override;
-  NetworkControlUpdate OnReceivedPacket(ReceivedPacket msg) override;
   NetworkControlUpdate OnNetworkStateEstimate(
       NetworkStateEstimate msg) override;
 
diff --git a/test/scenario/call_client.cc b/test/scenario/call_client.cc
index d2019ae..99e702f 100644
--- a/test/scenario/call_client.cc
+++ b/test/scenario/call_client.cc
@@ -122,10 +122,6 @@
 NetworkControlUpdate NetworkControleUpdateCache::OnSentPacket(SentPacket msg) {
   return Update(controller_->OnSentPacket(msg));
 }
-NetworkControlUpdate NetworkControleUpdateCache::OnReceivedPacket(
-    ReceivedPacket msg) {
-  return Update(controller_->OnReceivedPacket(msg));
-}
 NetworkControlUpdate NetworkControleUpdateCache::OnStreamsConfig(
     StreamsConfig msg) {
   return Update(controller_->OnStreamsConfig(msg));
diff --git a/test/scenario/call_client.h b/test/scenario/call_client.h
index 3717a7e..0208cac 100644
--- a/test/scenario/call_client.h
+++ b/test/scenario/call_client.h
@@ -47,7 +47,6 @@
   NetworkControlUpdate OnRemoteBitrateReport(RemoteBitrateReport msg) override;
   NetworkControlUpdate OnRoundTripTimeUpdate(RoundTripTimeUpdate msg) override;
   NetworkControlUpdate OnSentPacket(SentPacket msg) override;
-  NetworkControlUpdate OnReceivedPacket(ReceivedPacket msg) override;
   NetworkControlUpdate OnStreamsConfig(StreamsConfig msg) override;
   NetworkControlUpdate OnTargetRateConstraints(
       TargetRateConstraints msg) override;