Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: webrtc/call/call.cc

Issue 2834663003: Allow mocking SendSideCongestionController for Call tests. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/call/call.h ('k') | webrtc/call/call_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 0e64269d4e4c70391a00be65da2440778bb14197..e594dcc6cadce83560ac48f325c60c4637a566d2 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 @@ class Call : public webrtc::Call,
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 @@ std::string Call::Stats::ToString(int64_t time_ms) const {
}
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 @@ Call::Call(const Call::Config& config,
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(
« no previous file with comments | « webrtc/call/call.h ('k') | webrtc/call/call_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698