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

Side by Side Diff: webrtc/api/peerconnection.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 | « no previous file | webrtc/api/quicdatachannel.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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 PeerConnectionInterface::kTlsCertPolicyInsecureNoCheck) { 320 PeerConnectionInterface::kTlsCertPolicyInsecureNoCheck) {
321 config.tls_cert_policy = 321 config.tls_cert_policy =
322 cricket::TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK; 322 cricket::TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK;
323 } 323 }
324 turn_servers->push_back(config); 324 turn_servers->push_back(config);
325 break; 325 break;
326 } 326 }
327 default: 327 default:
328 // We shouldn't get to this point with an invalid service_type, we should 328 // We shouldn't get to this point with an invalid service_type, we should
329 // have returned an error already. 329 // have returned an error already.
330 RTC_DCHECK(false) << "Unexpected service type"; 330 RTC_NOTREACHED() << "Unexpected service type";
331 return RTCErrorType::INTERNAL_ERROR; 331 return RTCErrorType::INTERNAL_ERROR;
332 } 332 }
333 return RTCErrorType::NONE; 333 return RTCErrorType::NONE;
334 } 334 }
335 335
336 // Check if we can send |new_stream| on a PeerConnection. 336 // Check if we can send |new_stream| on a PeerConnection.
337 bool CanAddLocalMediaStream(webrtc::StreamCollectionInterface* current_streams, 337 bool CanAddLocalMediaStream(webrtc::StreamCollectionInterface* current_streams,
338 webrtc::MediaStreamInterface* new_stream) { 338 webrtc::MediaStreamInterface* new_stream) {
339 if (!new_stream || !current_streams) { 339 if (!new_stream || !current_streams) {
340 return false; 340 return false;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 bool PeerConnectionInterface::RTCConfiguration::operator!=( 541 bool PeerConnectionInterface::RTCConfiguration::operator!=(
542 const PeerConnectionInterface::RTCConfiguration& o) const { 542 const PeerConnectionInterface::RTCConfiguration& o) const {
543 return !(*this == o); 543 return !(*this == o);
544 } 544 }
545 545
546 // Generate a RTCP CNAME when a PeerConnection is created. 546 // Generate a RTCP CNAME when a PeerConnection is created.
547 std::string GenerateRtcpCname() { 547 std::string GenerateRtcpCname() {
548 std::string cname; 548 std::string cname;
549 if (!rtc::CreateRandomString(kRtcpCnameLength, &cname)) { 549 if (!rtc::CreateRandomString(kRtcpCnameLength, &cname)) {
550 LOG(LS_ERROR) << "Failed to generate CNAME."; 550 LOG(LS_ERROR) << "Failed to generate CNAME.";
551 RTC_DCHECK(false); 551 RTC_NOTREACHED();
552 } 552 }
553 return cname; 553 return cname;
554 } 554 }
555 555
556 bool ExtractMediaSessionOptions( 556 bool ExtractMediaSessionOptions(
557 const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options, 557 const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options,
558 bool is_offer, 558 bool is_offer,
559 cricket::MediaSessionOptions* session_options) { 559 cricket::MediaSessionOptions* session_options) {
560 typedef PeerConnectionInterface::RTCOfferAnswerOptions RTCOfferAnswerOptions; 560 typedef PeerConnectionInterface::RTCOfferAnswerOptions RTCOfferAnswerOptions;
561 if (!IsValidOfferToReceiveMedia(rtc_options.offer_to_receive_audio) || 561 if (!IsValidOfferToReceiveMedia(rtc_options.offer_to_receive_audio) ||
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 stats_->GetStats(param->track, reports.get()); 1610 stats_->GetStats(param->track, reports.get());
1611 param->observer->OnCompleteReports(std::move(reports)); 1611 param->observer->OnCompleteReports(std::move(reports));
1612 delete param; 1612 delete param;
1613 break; 1613 break;
1614 } 1614 }
1615 case MSG_FREE_DATACHANNELS: { 1615 case MSG_FREE_DATACHANNELS: {
1616 sctp_data_channels_to_free_.clear(); 1616 sctp_data_channels_to_free_.clear();
1617 break; 1617 break;
1618 } 1618 }
1619 default: 1619 default:
1620 RTC_DCHECK(false && "Not implemented"); 1620 RTC_NOTREACHED() << "Not implemented";
1621 break; 1621 break;
1622 } 1622 }
1623 } 1623 }
1624 1624
1625 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, 1625 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream,
1626 const std::string& track_id, 1626 const std::string& track_id,
1627 uint32_t ssrc) { 1627 uint32_t ssrc) {
1628 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> 1628 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
1629 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( 1629 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
1630 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, 1630 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc,
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 const std::string& track_id, 2035 const std::string& track_id,
2036 uint32_t ssrc, 2036 uint32_t ssrc,
2037 cricket::MediaType media_type) { 2037 cricket::MediaType media_type) {
2038 MediaStreamInterface* stream = remote_streams_->find(stream_label); 2038 MediaStreamInterface* stream = remote_streams_->find(stream_label);
2039 2039
2040 if (media_type == cricket::MEDIA_TYPE_AUDIO) { 2040 if (media_type == cricket::MEDIA_TYPE_AUDIO) {
2041 CreateAudioReceiver(stream, track_id, ssrc); 2041 CreateAudioReceiver(stream, track_id, ssrc);
2042 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { 2042 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
2043 CreateVideoReceiver(stream, track_id, ssrc); 2043 CreateVideoReceiver(stream, track_id, ssrc);
2044 } else { 2044 } else {
2045 RTC_DCHECK(false && "Invalid media type"); 2045 RTC_NOTREACHED() << "Invalid media type";
2046 } 2046 }
2047 } 2047 }
2048 2048
2049 void PeerConnection::OnRemoteTrackRemoved(const std::string& stream_label, 2049 void PeerConnection::OnRemoteTrackRemoved(const std::string& stream_label,
2050 const std::string& track_id, 2050 const std::string& track_id,
2051 cricket::MediaType media_type) { 2051 cricket::MediaType media_type) {
2052 MediaStreamInterface* stream = remote_streams_->find(stream_label); 2052 MediaStreamInterface* stream = remote_streams_->find(stream_label);
2053 2053
2054 if (media_type == cricket::MEDIA_TYPE_AUDIO) { 2054 if (media_type == cricket::MEDIA_TYPE_AUDIO) {
2055 // When the MediaEngine audio channel is destroyed, the RemoteAudioSource 2055 // When the MediaEngine audio channel is destroyed, the RemoteAudioSource
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 2564
2565 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, 2565 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
2566 int64_t max_size_bytes) { 2566 int64_t max_size_bytes) {
2567 return event_log_->StartLogging(file, max_size_bytes); 2567 return event_log_->StartLogging(file, max_size_bytes);
2568 } 2568 }
2569 2569
2570 void PeerConnection::StopRtcEventLog_w() { 2570 void PeerConnection::StopRtcEventLog_w() {
2571 event_log_->StopLogging(); 2571 event_log_->StopLogging();
2572 } 2572 }
2573 } // namespace webrtc 2573 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/quicdatachannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698