This will allow me to test that Call invokes SendSideCongestionController::SetBweBitrates as expected (for https://codereview.chromium.org/2793913008).
FakeRtpTransportController moves to a common header and its constructor is changed to take a SendSideCongestionController to enable injecting the mock.
BUG=webrtc:7395
Review-Url: https://codereview.webrtc.org/2834663003
Cr-Commit-Position: refs/heads/master@{#18055}
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 0e64269..e594dcc 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -26,6 +26,7 @@
#include "webrtc/base/location.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/optional.h"
+#include "webrtc/base/ptr_util.h"
#include "webrtc/base/task_queue.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/base/thread_checker.h"
@@ -97,7 +98,7 @@
public BitrateAllocator::LimitObserver {
public:
Call(const Call::Config& config,
- std::unique_ptr<RtpTransportControllerSend> transport_send);
+ std::unique_ptr<RtpTransportControllerSendInterface> transport_send);
virtual ~Call();
// Implements webrtc::Call.
@@ -298,16 +299,21 @@
}
Call* Call::Create(const Call::Config& config) {
- return new internal::Call(
- config, std::unique_ptr<RtpTransportControllerSend>(
- new RtpTransportControllerSend(Clock::GetRealTimeClock(),
- config.event_log)));
+ return new internal::Call(config,
+ rtc::MakeUnique<RtpTransportControllerSend>(
+ Clock::GetRealTimeClock(), config.event_log));
+}
+
+Call* Call::Create(
+ const Call::Config& config,
+ std::unique_ptr<RtpTransportControllerSendInterface> transport_send) {
+ return new internal::Call(config, std::move(transport_send));
}
namespace internal {
Call::Call(const Call::Config& config,
- std::unique_ptr<RtpTransportControllerSend> transport_send)
+ std::unique_ptr<RtpTransportControllerSendInterface> transport_send)
: clock_(Clock::GetRealTimeClock()),
num_cpu_cores_(CpuInfo::DetectNumberOfCores()),
module_process_thread_(ProcessThread::Create("ModuleProcessThread")),
@@ -342,7 +348,7 @@
config.bitrate_config.start_bitrate_bps);
}
Trace::CreateTrace();
- transport_send->RegisterNetworkObserver(this);
+ transport_send->send_side_cc()->RegisterNetworkObserver(this);
transport_send_ = std::move(transport_send);
transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown);
transport_send_->send_side_cc()->SetBweBitrates(