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

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

Issue 2753283002: Fix crash on multiple feedback messages are received on old transport. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 void CongestionController::AddPacket(uint16_t sequence_number, 339 void CongestionController::AddPacket(uint16_t sequence_number,
340 size_t length, 340 size_t length,
341 const PacedPacketInfo& pacing_info) { 341 const PacedPacketInfo& pacing_info) {
342 transport_feedback_adapter_.AddPacket(sequence_number, length, pacing_info); 342 transport_feedback_adapter_.AddPacket(sequence_number, length, pacing_info);
343 } 343 }
344 344
345 void CongestionController::OnTransportFeedback( 345 void CongestionController::OnTransportFeedback(
346 const rtcp::TransportFeedback& feedback) { 346 const rtcp::TransportFeedback& feedback) {
347 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 347 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
348 transport_feedback_adapter_.OnTransportFeedback(feedback); 348 transport_feedback_adapter_.OnTransportFeedback(feedback);
349 std::vector<PacketFeedback> feedback_vector =
350 transport_feedback_adapter_.GetTransportFeedbackVector();
351 if (feedback_vector.empty())
352 return;
349 DelayBasedBwe::Result result; 353 DelayBasedBwe::Result result;
350 { 354 {
351 rtc::CritScope cs(&bwe_lock_); 355 rtc::CritScope cs(&bwe_lock_);
352 result = delay_based_bwe_->IncomingPacketFeedbackVector( 356 result = delay_based_bwe_->IncomingPacketFeedbackVector(feedback_vector);
353 transport_feedback_adapter_.GetTransportFeedbackVector());
354 } 357 }
355 if (result.updated) 358 if (result.updated)
356 bitrate_controller_->OnDelayBasedBweResult(result); 359 bitrate_controller_->OnDelayBasedBweResult(result);
357 } 360 }
358 361
359 std::vector<PacketFeedback> CongestionController::GetTransportFeedbackVector() 362 std::vector<PacketFeedback> CongestionController::GetTransportFeedbackVector()
360 const { 363 const {
361 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 364 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
362 return transport_feedback_adapter_.GetTransportFeedbackVector(); 365 return transport_feedback_adapter_.GetTransportFeedbackVector();
363 } 366 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 bool CongestionController::IsSendQueueFull() const { 418 bool CongestionController::IsSendQueueFull() const {
416 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 419 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
417 } 420 }
418 421
419 bool CongestionController::IsNetworkDown() const { 422 bool CongestionController::IsNetworkDown() const {
420 rtc::CritScope cs(&network_state_lock_); 423 rtc::CritScope cs(&network_state_lock_);
421 return network_state_ == kNetworkDown; 424 return network_state_ == kNetworkDown;
422 } 425 }
423 426
424 } // namespace webrtc 427 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698