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

Side by Side Diff: webrtc/api/quicdatachannel.cc

Issue 2623313004: Replace RTC_DCHECK(false) with RTC_NOTREACHED(). (Closed)
Patch Set: Created 3 years, 11 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 | « webrtc/api/peerconnection.cc ('k') | webrtc/api/quicdatatransport.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 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 << ". Unexpected error: " << message_result; 166 << ". Unexpected error: " << message_result;
167 return false; 167 return false;
168 } 168 }
169 169
170 void QuicDataChannel::OnQueuedBytesWritten(net::QuicStreamId stream_id, 170 void QuicDataChannel::OnQueuedBytesWritten(net::QuicStreamId stream_id,
171 uint64_t queued_bytes_written) { 171 uint64_t queued_bytes_written) {
172 RTC_DCHECK(worker_thread_->IsCurrent()); 172 RTC_DCHECK(worker_thread_->IsCurrent());
173 SetBufferedAmount_w(buffered_amount_ - queued_bytes_written); 173 SetBufferedAmount_w(buffered_amount_ - queued_bytes_written);
174 const auto& kv = write_blocked_quic_streams_.find(stream_id); 174 const auto& kv = write_blocked_quic_streams_.find(stream_id);
175 if (kv == write_blocked_quic_streams_.end()) { 175 if (kv == write_blocked_quic_streams_.end()) {
176 RTC_DCHECK(false); 176 RTC_NOTREACHED();
177 return; 177 return;
178 } 178 }
179 cricket::ReliableQuicStream* stream = kv->second; 179 cricket::ReliableQuicStream* stream = kv->second;
180 // True if the QUIC stream is done sending data. 180 // True if the QUIC stream is done sending data.
181 if (stream->fin_sent()) { 181 if (stream->fin_sent()) {
182 LOG(LS_INFO) << "Stream " << stream->id() 182 LOG(LS_INFO) << "Stream " << stream->id()
183 << " successfully wrote data for QUIC data channel " << id_; 183 << " successfully wrote data for QUIC data channel " << id_;
184 stream->Close(); 184 stream->Close();
185 } 185 }
186 } 186 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 this, &QuicDataChannel::OnIncomingQueuedStreamClosed); 294 this, &QuicDataChannel::OnIncomingQueuedStreamClosed);
295 } 295 }
296 296
297 void QuicDataChannel::OnDataReceived(net::QuicStreamId stream_id, 297 void QuicDataChannel::OnDataReceived(net::QuicStreamId stream_id,
298 const char* data, 298 const char* data,
299 size_t len) { 299 size_t len) {
300 RTC_DCHECK(network_thread_->IsCurrent()); 300 RTC_DCHECK(network_thread_->IsCurrent());
301 RTC_DCHECK(data); 301 RTC_DCHECK(data);
302 const auto& kv = incoming_quic_messages_.find(stream_id); 302 const auto& kv = incoming_quic_messages_.find(stream_id);
303 if (kv == incoming_quic_messages_.end()) { 303 if (kv == incoming_quic_messages_.end()) {
304 RTC_DCHECK(false); 304 RTC_NOTREACHED();
305 return; 305 return;
306 } 306 }
307 Message& message = kv->second; 307 Message& message = kv->second;
308 cricket::ReliableQuicStream* stream = message.stream; 308 cricket::ReliableQuicStream* stream = message.stream;
309 rtc::CopyOnWriteBuffer& received_data = message.buffer; 309 rtc::CopyOnWriteBuffer& received_data = message.buffer;
310 // If the QUIC stream has not received a FIN, then the remote peer is not 310 // If the QUIC stream has not received a FIN, then the remote peer is not
311 // finished sending data. 311 // finished sending data.
312 if (!stream->fin_received()) { 312 if (!stream->fin_received()) {
313 received_data.AppendData(data, len); 313 received_data.AppendData(data, len);
314 return; 314 return;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 size_t QuicDataChannel::GetNumWriteBlockedStreams() const { 388 size_t QuicDataChannel::GetNumWriteBlockedStreams() const {
389 return write_blocked_quic_streams_.size(); 389 return write_blocked_quic_streams_.size();
390 } 390 }
391 391
392 size_t QuicDataChannel::GetNumIncomingStreams() const { 392 size_t QuicDataChannel::GetNumIncomingStreams() const {
393 return incoming_quic_messages_.size(); 393 return incoming_quic_messages_.size();
394 } 394 }
395 395
396 } // namespace webrtc 396 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/quicdatatransport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698