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

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

Issue 2710213003: Add thread-checking to TransportFeedbackAdapter (Closed)
Patch Set: Created 3 years, 10 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups 148 LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups
149 << " packet" << (failed_lookups > 1 ? "s" : "") 149 << " packet" << (failed_lookups > 1 ? "s" : "")
150 << ". Send time history too small?"; 150 << ". Send time history too small?";
151 } 151 }
152 } 152 }
153 return packet_feedback_vector; 153 return packet_feedback_vector;
154 } 154 }
155 155
156 void TransportFeedbackAdapter::OnTransportFeedback( 156 void TransportFeedbackAdapter::OnTransportFeedback(
157 const rtcp::TransportFeedback& feedback) { 157 const rtcp::TransportFeedback& feedback) {
158 RTC_DCHECK(last_packet_feedback_vector_thread_checker_.CalledOnValidThread());
158 last_packet_feedback_vector_ = GetPacketFeedbackVector(feedback); 159 last_packet_feedback_vector_ = GetPacketFeedbackVector(feedback);
159 DelayBasedBwe::Result result; 160 DelayBasedBwe::Result result;
160 { 161 {
161 rtc::CritScope cs(&bwe_lock_); 162 rtc::CritScope cs(&bwe_lock_);
162 result = delay_based_bwe_->IncomingPacketFeedbackVector( 163 result = delay_based_bwe_->IncomingPacketFeedbackVector(
163 last_packet_feedback_vector_); 164 last_packet_feedback_vector_);
164 } 165 }
165 if (result.updated) 166 if (result.updated)
166 bitrate_controller_->OnDelayBasedBweResult(result); 167 bitrate_controller_->OnDelayBasedBweResult(result);
167 } 168 }
168 169
169 std::vector<PacketInfo> TransportFeedbackAdapter::GetTransportFeedbackVector() 170 std::vector<PacketInfo> TransportFeedbackAdapter::GetTransportFeedbackVector()
170 const { 171 const {
172 RTC_DCHECK(last_packet_feedback_vector_thread_checker_.CalledOnValidThread());
171 return last_packet_feedback_vector_; 173 return last_packet_feedback_vector_;
172 } 174 }
173 175
174 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, 176 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms,
175 int64_t max_rtt_ms) { 177 int64_t max_rtt_ms) {
176 rtc::CritScope cs(&bwe_lock_); 178 rtc::CritScope cs(&bwe_lock_);
177 delay_based_bwe_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); 179 delay_based_bwe_->OnRttUpdate(avg_rtt_ms, max_rtt_ms);
178 } 180 }
179 181
180 } // namespace webrtc 182 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698