Removes injection of RtpTransportControllerSend from Call::Create.

Bug: webrtc:10365
Change-Id: Ie319611828116f8ffbb582d5ab2099240b26699e
Reviewed-on: https://webrtc-review.googlesource.com/c/124784
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26926}
diff --git a/call/call.cc b/call/call.cc
index 5df97e9..6655e22 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -419,12 +419,6 @@
                   config.network_controller_factory, config.bitrate_config));
 }
 
-Call* Call::Create(
-    const Call::Config& config,
-    std::unique_ptr<RtpTransportControllerSendInterface> transport_send) {
-  return new internal::Call(config, std::move(transport_send));
-}
-
 // This method here to avoid subclasses has to implement this method.
 // Call perf test will use Internal::Call::CreateVideoSendStream() to inject
 // FecController.
diff --git a/call/call.h b/call/call.h
index ab834f3..eb5596d 100644
--- a/call/call.h
+++ b/call/call.h
@@ -50,11 +50,6 @@
 
   static Call* Create(const Call::Config& config);
 
-  // Allows mocking |transport_send| for testing.
-  static Call* Create(
-      const Call::Config& config,
-      std::unique_ptr<RtpTransportControllerSendInterface> transport_send);
-
   virtual AudioSendStream* CreateAudioSendStream(
       const AudioSendStream::Config& config) = 0;
 
diff --git a/test/call_test.cc b/test/call_test.cc
index b8334b5..44df9cb 100644
--- a/test/call_test.cc
+++ b/test/call_test.cc
@@ -18,7 +18,6 @@
 #include "api/video/builtin_video_bitrate_allocator_factory.h"
 #include "api/video_codecs/video_encoder_config.h"
 #include "call/fake_network_pipe.h"
-#include "call/rtp_transport_controller_send.h"
 #include "call/simulated_network.h"
 #include "modules/audio_mixer/audio_mixer_impl.h"
 #include "rtc_base/checks.h"
@@ -33,7 +32,6 @@
     : clock_(Clock::GetRealTimeClock()),
       send_event_log_(RtcEventLog::CreateNull()),
       recv_event_log_(RtcEventLog::CreateNull()),
-      sender_call_transport_controller_(nullptr),
       audio_send_config_(/*send_transport=*/nullptr,
                          /*media_transport=*/nullptr),
       audio_send_stream_(nullptr),
@@ -113,10 +111,6 @@
           send_config.audio_state->audio_transport());
     }
     CreateSenderCall(send_config);
-    if (sender_call_transport_controller_ != nullptr) {
-      test->OnRtpTransportControllerSendCreated(
-          sender_call_transport_controller_);
-    }
     if (test->ShouldCreateReceivers()) {
       Call::Config recv_config(recv_event_log_.get());
       test->ModifyReceiverBitrateConfig(&recv_config.bitrate_config);
@@ -221,20 +215,7 @@
 }
 
 void CallTest::CreateSenderCall(const Call::Config& config) {
-  NetworkControllerFactoryInterface* injected_factory =
-      config.network_controller_factory;
-  if (injected_factory) {
-    RTC_LOG(LS_INFO) << "Using injected network controller factory";
-  } else {
-    RTC_LOG(LS_INFO) << "Using default network controller factory";
-  }
-
-  std::unique_ptr<RtpTransportControllerSend> controller_send =
-      absl::make_unique<RtpTransportControllerSend>(
-          Clock::GetRealTimeClock(), config.event_log, injected_factory,
-          config.bitrate_config);
-  sender_call_transport_controller_ = controller_send.get();
-  sender_call_.reset(Call::Create(config, std::move(controller_send)));
+  sender_call_.reset(Call::Create(config));
 }
 
 void CallTest::CreateReceiverCall(const Call::Config& config) {
@@ -761,9 +742,6 @@
 void BaseTest::ModifyReceiverBitrateConfig(BitrateConstraints* bitrate_config) {
 }
 
-void BaseTest::OnRtpTransportControllerSendCreated(
-    RtpTransportControllerSend* controller) {}
-
 void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) {}
 
 test::PacketTransport* BaseTest::CreateSendTransport(
diff --git a/test/call_test.h b/test/call_test.h
index dbe8e07..052d4c6 100644
--- a/test/call_test.h
+++ b/test/call_test.h
@@ -20,7 +20,6 @@
 #include "api/test/video/function_video_encoder_factory.h"
 #include "api/video/video_bitrate_allocator_factory.h"
 #include "call/call.h"
-#include "call/rtp_transport_controller_send.h"
 #include "logging/rtc_event_log/rtc_event_log.h"
 #include "modules/audio_device/include/test_audio_device.h"
 #include "test/encoder_settings.h"
@@ -179,7 +178,6 @@
   std::unique_ptr<webrtc::RtcEventLog> send_event_log_;
   std::unique_ptr<webrtc::RtcEventLog> recv_event_log_;
   std::unique_ptr<Call> sender_call_;
-  RtpTransportControllerSend* sender_call_transport_controller_;
   std::unique_ptr<PacketTransport> send_transport_;
   std::vector<VideoSendStream::Config> video_send_configs_;
   std::vector<VideoEncoderConfig> video_encoder_configs_;
@@ -254,8 +252,6 @@
   virtual void ModifySenderBitrateConfig(BitrateConstraints* bitrate_config);
   virtual void ModifyReceiverBitrateConfig(BitrateConstraints* bitrate_config);
 
-  virtual void OnRtpTransportControllerSendCreated(
-      RtpTransportControllerSend* controller);
   virtual void OnCallsCreated(Call* sender_call, Call* receiver_call);
 
   virtual test::PacketTransport* CreateSendTransport(
diff --git a/video/end_to_end_tests/probing_tests.cc b/video/end_to_end_tests/probing_tests.cc
index dba3c3e..df2caf9 100644
--- a/video/end_to_end_tests/probing_tests.cc
+++ b/video/end_to_end_tests/probing_tests.cc
@@ -210,11 +210,6 @@
       send_stream_ = send_stream;
     }
 
-    void OnRtpTransportControllerSendCreated(
-        RtpTransportControllerSend* transport_controller) override {
-      transport_controller_ = transport_controller;
-    }
-
     test::PacketTransport* CreateSendTransport(
         test::SingleThreadedTaskQueueForTesting* task_queue,
         Call* sender_call) override {
@@ -250,8 +245,10 @@
               // In order to speed up the test we can interrupt exponential
               // probing by toggling the network availability. The alternative
               // is to wait for it to time out (1000 ms).
-              transport_controller_->OnNetworkAvailability(false);
-              transport_controller_->OnNetworkAvailability(true);
+              sender_call_->GetTransportControllerSend()->OnNetworkAvailability(
+                  false);
+              sender_call_->GetTransportControllerSend()->OnNetworkAvailability(
+                  true);
 
               ++state_;
             }
@@ -288,7 +285,6 @@
     SimulatedNetwork* send_simulated_network_;
     VideoSendStream* send_stream_;
     VideoEncoderConfig* encoder_config_;
-    RtpTransportControllerSend* transport_controller_;
   };
 
   bool success = false;