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

Side by Side Diff: talk/app/webrtc/webrtcsession.cc

Issue 1369773003: Add a continual_gathering_policy in PeerConnection RTCConfiguration (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Addressed comments Created 5 years, 2 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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 // Obtain a certificate from RTCConfiguration if any were provided (optional). 602 // Obtain a certificate from RTCConfiguration if any were provided (optional).
603 rtc::scoped_refptr<rtc::RTCCertificate> certificate; 603 rtc::scoped_refptr<rtc::RTCCertificate> certificate;
604 if (!rtc_configuration.certificates.empty()) { 604 if (!rtc_configuration.certificates.empty()) {
605 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of 605 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of
606 // just picking the first one. The decision should be made based on the DTLS 606 // just picking the first one. The decision should be made based on the DTLS
607 // handshake. The DTLS negotiations need to know about all certificates. 607 // handshake. The DTLS negotiations need to know about all certificates.
608 certificate = rtc_configuration.certificates[0]; 608 certificate = rtc_configuration.certificates[0];
609 } 609 }
610 610
611 SetIceConnectionReceivingTimeout( 611 SetIceConfig(ParseIceConfig(rtc_configuration));
612 rtc_configuration.ice_connection_receiving_timeout);
613 612
614 // TODO(perkj): Take |constraints| into consideration. Return false if not all 613 // TODO(perkj): Take |constraints| into consideration. Return false if not all
615 // mandatory constraints can be fulfilled. Note that |constraints| 614 // mandatory constraints can be fulfilled. Note that |constraints|
616 // can be null. 615 // can be null.
617 bool value; 616 bool value;
618 617
619 if (options.disable_encryption) { 618 if (options.disable_encryption) {
620 dtls_enabled_ = false; 619 dtls_enabled_ = false;
621 } else { 620 } else {
622 // Enable DTLS by default if we have an identity store or a certificate. 621 // Enable DTLS by default if we have an identity store or a certificate.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 port_allocator()->flags() | 774 port_allocator()->flags() |
776 cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); 775 cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE);
777 } 776 }
778 777
779 media_controller_.reset(MediaControllerInterface::Create( 778 media_controller_.reset(MediaControllerInterface::Create(
780 worker_thread(), channel_manager_->media_engine()->GetVoE())); 779 worker_thread(), channel_manager_->media_engine()->GetVoE()));
781 780
782 return true; 781 return true;
783 } 782 }
784 783
784 cricket::IceConfig WebRtcSession::ParseIceConfig(
785 const PeerConnectionInterface::RTCConfiguration& config) const {
786 cricket::IceConfig ice_config;
787 ice_config.receiving_timeout_ms = config.ice_connection_receiving_timeout;
788 ice_config.continuous_gathering =
789 (config.continuous_gathering_policy ==
790 PeerConnectionInterface::kGatheringContinuously);
pthatcher1 2015/09/25 22:26:57 gather_continually.
honghaiz3 2015/09/25 23:05:00 Done.
791 return ice_config;
792 }
793
785 void WebRtcSession::Terminate() { 794 void WebRtcSession::Terminate() {
786 SetState(STATE_RECEIVEDTERMINATE); 795 SetState(STATE_RECEIVEDTERMINATE);
787 RemoveUnusedChannels(NULL); 796 RemoveUnusedChannels(NULL);
788 ASSERT(!voice_channel_); 797 ASSERT(!voice_channel_);
789 ASSERT(!video_channel_); 798 ASSERT(!video_channel_);
790 ASSERT(!data_channel_); 799 ASSERT(!data_channel_);
791 } 800 }
792 801
793 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { 802 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) {
794 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); 803 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy);
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 2173
2165 if (!srtp_cipher.empty()) { 2174 if (!srtp_cipher.empty()) {
2166 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); 2175 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher);
2167 } 2176 }
2168 if (!ssl_cipher.empty()) { 2177 if (!ssl_cipher.empty()) {
2169 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); 2178 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher);
2170 } 2179 }
2171 } 2180 }
2172 2181
2173 } // namespace webrtc 2182 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698