Move TaskQueueFactory from Call::Create parameter to CallConfig
to decouple it from other optional parameters
and with plan to make it mandatory
Bug: webrtc:10284
Change-Id: I71c1d3d9eaf09d00b99b0bc4c811ab173ea5f01f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130473
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27385}diff --git a/call/call.cc b/call/call.cc
index 3f7ef5f..e458c48 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -424,16 +424,20 @@
}
Call* Call::Create(const Call::Config& config) {
- return Create(
- config, Clock::GetRealTimeClock(), ProcessThread::Create("PacerThread"),
- ProcessThread::Create("ModuleProcessThread"), &GlobalTaskQueueFactory());
+ return Create(config, Clock::GetRealTimeClock(),
+ ProcessThread::Create("PacerThread"),
+ ProcessThread::Create("ModuleProcessThread"));
}
Call* Call::Create(const Call::Config& config,
Clock* clock,
std::unique_ptr<ProcessThread> call_thread,
- std::unique_ptr<ProcessThread> pacer_thread,
- TaskQueueFactory* task_queue_factory) {
+ std::unique_ptr<ProcessThread> pacer_thread) {
+ // TODO(bugs.webrtc.org/10284): DCHECK task_queue_factory dependency is
+ // always provided in the config.
+ TaskQueueFactory* task_queue_factory = config.task_queue_factory
+ ? config.task_queue_factory
+ : &GlobalTaskQueueFactory();
return new internal::Call(
clock, config,
absl::make_unique<RtpTransportControllerSend>(