Move almost all references from WebRtcSession to PeerConnection

WebRtcSession is being merged into PeerConnection, and to make the
code review easier this is the first step towards achieving that.

Bug: webrtc:8323
Change-Id: I33778e46f20cb14089dff4328947868e207476bd
Reviewed-on: https://webrtc-review.googlesource.com/8760
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20413}
This commit is contained in:
Steve Anton
2017-10-23 14:49:26 -07:00
committed by Commit Bot
parent c4faa9c4e1
commit d5585ca956
9 changed files with 68 additions and 111 deletions

View File

@ -29,6 +29,7 @@ class TransportDescriptionFactory;
namespace webrtc {
class CreateSessionDescriptionObserver;
class MediaConstraintsInterface;
class PeerConnection;
class SessionDescriptionInterface;
class WebRtcSession;
@ -74,20 +75,16 @@ struct CreateSessionDescriptionRequest {
class WebRtcSessionDescriptionFactory : public rtc::MessageHandler,
public sigslot::has_slots<> {
public:
// If |certificate_generator| is not null, DTLS is enabled and a default
// certificate is generated asynchronously; otherwise DTLS is disabled.
// Can specify either a |cert_generator| or |certificate| to enable DTLS. If
// a certificate generator is given, starts generating the certificate
// asynchronously. If a certificate is given, will use that for identifying
// over DTLS. If neither is specified, DTLS is disabled.
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
WebRtcSession* session,
const std::string& session_id,
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator);
// Construct with DTLS enabled using the specified |certificate|.
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
WebRtcSession* session,
PeerConnection* pc,
const std::string& session_id,
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
virtual ~WebRtcSessionDescriptionFactory();
@ -126,16 +123,6 @@ class WebRtcSessionDescriptionFactory : public rtc::MessageHandler,
CERTIFICATE_FAILED,
};
// If |certificate_generator| or |certificate| is not null DTLS is enabled,
// otherwise DTLS is disabled.
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
WebRtcSession* session,
const std::string& session_id,
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
// MessageHandler implementation.
virtual void OnMessage(rtc::Message* msg);
@ -161,8 +148,9 @@ class WebRtcSessionDescriptionFactory : public rtc::MessageHandler,
cricket::MediaSessionDescriptionFactory session_desc_factory_;
uint64_t session_version_;
const std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator_;
// TODO(jiayl): remove the dependency on session once bug 2264 is fixed.
WebRtcSession* const session_;
// TODO(jiayl): remove the dependency on peer connection once bug 2264 is
// fixed.
PeerConnection* const pc_;
const std::string session_id_;
CertificateRequestState certificate_request_state_;