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

Side by Side Diff: webrtc/api/webrtcsession.h

Issue 1671173002: Track pending ICE restarts independently for different media sections. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Extend ICE restart test to check that a second answer has new credentials. Created 4 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 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
11 #ifndef WEBRTC_API_WEBRTCSESSION_H_ 11 #ifndef WEBRTC_API_WEBRTCSESSION_H_
12 #define WEBRTC_API_WEBRTCSESSION_H_ 12 #define WEBRTC_API_WEBRTCSESSION_H_
13 13
14 #include <set>
14 #include <string> 15 #include <string>
15 #include <vector> 16 #include <vector>
16 17
17 #include "talk/session/media/mediasession.h" 18 #include "talk/session/media/mediasession.h"
18 #include "webrtc/api/datachannel.h" 19 #include "webrtc/api/datachannel.h"
19 #include "webrtc/api/dtmfsender.h" 20 #include "webrtc/api/dtmfsender.h"
20 #include "webrtc/api/mediacontroller.h" 21 #include "webrtc/api/mediacontroller.h"
21 #include "webrtc/api/mediastreamprovider.h" 22 #include "webrtc/api/mediastreamprovider.h"
22 #include "webrtc/api/peerconnectioninterface.h" 23 #include "webrtc/api/peerconnectioninterface.h"
23 #include "webrtc/api/statstypes.h" 24 #include "webrtc/api/statstypes.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 virtual cricket::VoiceChannel* voice_channel() { 173 virtual cricket::VoiceChannel* voice_channel() {
173 return voice_channel_.get(); 174 return voice_channel_.get();
174 } 175 }
175 virtual cricket::VideoChannel* video_channel() { 176 virtual cricket::VideoChannel* video_channel() {
176 return video_channel_.get(); 177 return video_channel_.get();
177 } 178 }
178 virtual cricket::DataChannel* data_channel() { 179 virtual cricket::DataChannel* data_channel() {
179 return data_channel_.get(); 180 return data_channel_.get();
180 } 181 }
181 182
183 cricket::BaseChannel* GetChannel(const std::string& content_name);
184
182 void SetSdesPolicy(cricket::SecurePolicy secure_policy); 185 void SetSdesPolicy(cricket::SecurePolicy secure_policy);
183 cricket::SecurePolicy SdesPolicy() const; 186 cricket::SecurePolicy SdesPolicy() const;
184 187
185 // Get current ssl role from transport. 188 // Get current ssl role from transport.
186 bool GetSslRole(const std::string& transport_name, rtc::SSLRole* role); 189 bool GetSslRole(const std::string& transport_name, rtc::SSLRole* role);
187 190
188 // Get current SSL role for this channel's transport. 191 // Get current SSL role for this channel's transport.
189 // If |transport| is null, returns false. 192 // If |transport| is null, returns false.
190 bool GetSslRole(const cricket::BaseChannel* channel, rtc::SSLRole* role); 193 bool GetSslRole(const cricket::BaseChannel* channel, rtc::SSLRole* role);
191 194
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 virtual bool GetLocalCertificate( 276 virtual bool GetLocalCertificate(
274 const std::string& transport_name, 277 const std::string& transport_name,
275 rtc::scoped_refptr<rtc::RTCCertificate>* certificate); 278 rtc::scoped_refptr<rtc::RTCCertificate>* certificate);
276 279
277 // Caller owns returned certificate 280 // Caller owns returned certificate
278 virtual bool GetRemoteSSLCertificate(const std::string& transport_name, 281 virtual bool GetRemoteSSLCertificate(const std::string& transport_name,
279 rtc::SSLCertificate** cert); 282 rtc::SSLCertificate** cert);
280 283
281 cricket::DataChannelType data_channel_type() const; 284 cricket::DataChannelType data_channel_type() const;
282 285
283 bool IceRestartPending() const; 286 bool IceRestartPending(const std::string& content_name) const;
284
285 void ResetIceRestartLatch();
286 287
287 // Called when an RTCCertificate is generated or retrieved by 288 // Called when an RTCCertificate is generated or retrieved by
288 // WebRTCSessionDescriptionFactory. Should happen before setLocalDescription. 289 // WebRTCSessionDescriptionFactory. Should happen before setLocalDescription.
289 void OnCertificateReady( 290 void OnCertificateReady(
290 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate); 291 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
291 void OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp); 292 void OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp);
292 293
293 // For unit test. 294 // For unit test.
294 bool waiting_for_certificate_for_testing() const; 295 bool waiting_for_certificate_for_testing() const;
295 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing(); 296 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 cricket::ContentAction action, 358 cricket::ContentAction action,
358 std::string* error_desc); 359 std::string* error_desc);
359 360
360 // Returns true and the TransportInfo of the given |content_name| 361 // Returns true and the TransportInfo of the given |content_name|
361 // from |description|. Returns false if it's not available. 362 // from |description|. Returns false if it's not available.
362 static bool GetTransportDescription( 363 static bool GetTransportDescription(
363 const cricket::SessionDescription* description, 364 const cricket::SessionDescription* description,
364 const std::string& content_name, 365 const std::string& content_name,
365 cricket::TransportDescription* info); 366 cricket::TransportDescription* info);
366 367
367 cricket::BaseChannel* GetChannel(const std::string& content_name);
368 // Cause all the BaseChannels in the bundle group to have the same 368 // Cause all the BaseChannels in the bundle group to have the same
369 // transport channel. 369 // transport channel.
370 bool EnableBundle(const cricket::ContentGroup& bundle); 370 bool EnableBundle(const cricket::ContentGroup& bundle);
371 371
372 // Enables media channels to allow sending of media. 372 // Enables media channels to allow sending of media.
373 void EnableChannels(); 373 void EnableChannels();
374 // Returns the media index for a local ice candidate given the content name. 374 // Returns the media index for a local ice candidate given the content name.
375 // Returns false if the local session description does not have a media 375 // Returns false if the local session description does not have a media
376 // content called |content_name|. 376 // content called |content_name|.
377 bool GetLocalCandidateMediaIndex(const std::string& content_name, 377 bool GetLocalCandidateMediaIndex(const std::string& content_name,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 bool older_version_remote_peer_; 475 bool older_version_remote_peer_;
476 bool dtls_enabled_; 476 bool dtls_enabled_;
477 // Specifies which kind of data channel is allowed. This is controlled 477 // Specifies which kind of data channel is allowed. This is controlled
478 // by the chrome command-line flag and constraints: 478 // by the chrome command-line flag and constraints:
479 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, 479 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled,
480 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is 480 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is
481 // not set or false, SCTP is allowed (DCT_SCTP); 481 // not set or false, SCTP is allowed (DCT_SCTP);
482 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); 482 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP);
483 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). 483 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE).
484 cricket::DataChannelType data_channel_type_; 484 cricket::DataChannelType data_channel_type_;
485 rtc::scoped_ptr<IceRestartAnswerLatch> ice_restart_latch_; 485 // List of content names for which the remote side triggered an ICE restart.
486 std::set<std::string> pending_ice_restarts_;
486 487
487 rtc::scoped_ptr<WebRtcSessionDescriptionFactory> 488 rtc::scoped_ptr<WebRtcSessionDescriptionFactory>
488 webrtc_session_desc_factory_; 489 webrtc_session_desc_factory_;
489 490
490 // Member variables for caching global options. 491 // Member variables for caching global options.
491 cricket::AudioOptions audio_options_; 492 cricket::AudioOptions audio_options_;
492 cricket::VideoOptions video_options_; 493 cricket::VideoOptions video_options_;
493 MetricsObserverInterface* metrics_observer_; 494 MetricsObserverInterface* metrics_observer_;
494 495
495 // Declares the bundle policy for the WebRTCSession. 496 // Declares the bundle policy for the WebRTCSession.
496 PeerConnectionInterface::BundlePolicy bundle_policy_; 497 PeerConnectionInterface::BundlePolicy bundle_policy_;
497 498
498 // Declares the RTCP mux policy for the WebRTCSession. 499 // Declares the RTCP mux policy for the WebRTCSession.
499 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; 500 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
500 501
501 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); 502 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
502 }; 503 };
503 } // namespace webrtc 504 } // namespace webrtc
504 505
505 #endif // WEBRTC_API_WEBRTCSESSION_H_ 506 #endif // WEBRTC_API_WEBRTCSESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698