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

Side by Side Diff: webrtc/modules/congestion_controller/send_side_congestion_controller.cc

Issue 2834663003: Allow mocking SendSideCongestionController for Call tests. (Closed)
Patch Set: Add MockSendSideCongestionController constructor Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 28 matching lines...) Expand all
39 if (*max_bitrate_bps > 0) 39 if (*max_bitrate_bps > 0)
40 *max_bitrate_bps = std::max(*min_bitrate_bps, *max_bitrate_bps); 40 *max_bitrate_bps = std::max(*min_bitrate_bps, *max_bitrate_bps);
41 if (*bitrate_bps > 0) 41 if (*bitrate_bps > 0)
42 *bitrate_bps = std::max(*min_bitrate_bps, *bitrate_bps); 42 *bitrate_bps = std::max(*min_bitrate_bps, *bitrate_bps);
43 } 43 }
44 44
45 } // namespace 45 } // namespace
46 46
47 SendSideCongestionController::SendSideCongestionController( 47 SendSideCongestionController::SendSideCongestionController(
48 const Clock* clock, 48 const Clock* clock,
49 Observer* observer,
50 RtcEventLog* event_log, 49 RtcEventLog* event_log,
51 PacketRouter* packet_router) 50 PacketRouter* packet_router)
52 : SendSideCongestionController( 51 : SendSideCongestionController(
53 clock, 52 clock,
54 observer,
55 event_log, 53 event_log,
56 std::unique_ptr<PacedSender>( 54 std::unique_ptr<PacedSender>(
57 new PacedSender(clock, packet_router, event_log))) {} 55 new PacedSender(clock, packet_router, event_log))) {}
58 56
59 SendSideCongestionController::SendSideCongestionController( 57 SendSideCongestionController::SendSideCongestionController(
60 const Clock* clock, 58 const Clock* clock,
61 Observer* observer,
62 RtcEventLog* event_log, 59 RtcEventLog* event_log,
63 std::unique_ptr<PacedSender> pacer) 60 std::unique_ptr<PacedSender> pacer)
64 : clock_(clock), 61 : clock_(clock),
65 observer_(observer),
66 event_log_(event_log), 62 event_log_(event_log),
67 pacer_(std::move(pacer)), 63 pacer_(std::move(pacer)),
68 bitrate_controller_( 64 bitrate_controller_(
69 BitrateController::CreateBitrateController(clock_, event_log)), 65 BitrateController::CreateBitrateController(clock_, event_log)),
70 probe_controller_(new ProbeController(pacer_.get(), clock_)), 66 probe_controller_(new ProbeController(pacer_.get(), clock_)),
71 retransmission_rate_limiter_( 67 retransmission_rate_limiter_(
72 new RateLimiter(clock, kRetransmitWindowSizeMs)), 68 new RateLimiter(clock, kRetransmitWindowSizeMs)),
73 transport_feedback_adapter_(clock_), 69 transport_feedback_adapter_(clock_),
74 last_reported_bitrate_bps_(0), 70 last_reported_bitrate_bps_(0),
75 last_reported_fraction_loss_(0), 71 last_reported_fraction_loss_(0),
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 bool SendSideCongestionController::IsSendQueueFull() const { 307 bool SendSideCongestionController::IsSendQueueFull() const {
312 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 308 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
313 } 309 }
314 310
315 bool SendSideCongestionController::IsNetworkDown() const { 311 bool SendSideCongestionController::IsNetworkDown() const {
316 rtc::CritScope cs(&network_state_lock_); 312 rtc::CritScope cs(&network_state_lock_);
317 return network_state_ == kNetworkDown; 313 return network_state_ == kNetworkDown;
318 } 314 }
319 315
320 } // namespace webrtc 316 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698