webrtc_m130/webrtc/api/webrtcsessiondescriptionfactory.h

180 lines
6.5 KiB
C
Raw Normal View History

/*
* Copyright 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_API_WEBRTCSESSIONDESCRIPTIONFACTORY_H_
#define WEBRTC_API_WEBRTCSESSIONDESCRIPTIONFACTORY_H_
#include <memory>
#include "webrtc/api/dtlsidentitystore.h"
#include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/rtccertificate.h"
Move talk/media to webrtc/media I removed the 'libjingle' target in talk/libjingle.gyp and replaced all users of it with base/base.gyp:rtc_base. It seems the jsoncpp and expat dependencies were not used by it's previous references. The files in talk/media/testdata were uploaded to Google Storage and added .sha1 files in resources/media instead of simply moving them. The previously disabled warnings that were inherited from talk/build/common.gypi are now replaced by target-specific disabling of only the failing warnings. Additional disabling was needed since the stricter compilation warnings that applies to code in webrtc/. License headers will be updated in a follow-up CL in order to not break Git history. Other modifications: * Updated the header guards. * Sorted the includes using chromium/src/tools/sort-headers.py except for these files: talk/app/webrtc/peerconnectionendtoend_unittest.cc talk/app/webrtc/java/jni/androidmediadecoder_jni.cc talk/app/webrtc/java/jni/androidmediaencoder_jni.cc webrtc/media/devices/win32devicemanager.cc. * Unused GYP reference to libjingle_tests_additional_deps was removed. * Removed duplicated GYP entries of webrtc/base/testutils.cc webrtc/base/testutils.h The HAVE_WEBRTC_VIDEO and HAVE_WEBRTC_VOICE defines were used by only talk/media, so they were moved to the media.gyp. I also checked that none of EXPAT_RELATIVE_PATH, FEATURE_ENABLE_VOICEMAIL, GTEST_RELATIVE_PATH, JSONCPP_RELATIVE_PATH, LOGGING=1, SRTP_RELATIVE_PATH, FEATURE_ENABLE_SSL, FEATURE_ENABLE_VOICEMAIL, FEATURE_ENABLE_PSTN, HAVE_SCTP, HAVE_SRTP, are used by the talk/media code. For Chromium, the following changes will need to be applied to the roll CL that updates the DEPS for WebRTC and libjingle: https://codereview.chromium.org/1604303002/ BUG=webrtc:5420 NOPRESUBMIT=True TBR=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1587193006 Cr-Commit-Position: refs/heads/master@{#11495}
2016-02-04 23:52:28 -08:00
#include "webrtc/p2p/base/transportdescriptionfactory.h"
#include "webrtc/pc/mediasession.h"
namespace cricket {
class ChannelManager;
class TransportDescriptionFactory;
} // namespace cricket
namespace webrtc {
class CreateSessionDescriptionObserver;
class MediaConstraintsInterface;
class SessionDescriptionInterface;
class WebRtcSession;
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
// DTLS identity request callback class.
class WebRtcIdentityRequestObserver : public DtlsIdentityRequestObserver,
public sigslot::has_slots<> {
public:
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
// DtlsIdentityRequestObserver overrides.
void OnFailure(int error) override;
void OnSuccess(const std::string& der_cert,
const std::string& der_private_key) override;
void OnSuccess(std::unique_ptr<rtc::SSLIdentity> identity) override;
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
sigslot::signal1<int> SignalRequestFailed;
sigslot::signal1<const rtc::scoped_refptr<rtc::RTCCertificate>&>
SignalCertificateReady;
};
struct CreateSessionDescriptionRequest {
enum Type {
kOffer,
kAnswer,
};
CreateSessionDescriptionRequest(
Type type,
CreateSessionDescriptionObserver* observer,
const cricket::MediaSessionOptions& options)
: type(type),
observer(observer),
options(options) {}
Type type;
rtc::scoped_refptr<CreateSessionDescriptionObserver> observer;
cricket::MediaSessionOptions options;
};
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
// This class is used to create offer/answer session description with regards to
// the async DTLS identity generation for WebRtcSession.
// It queues the create offer/answer request until the DTLS identity
// request has completed, i.e. when OnIdentityRequestFailed or OnIdentityReady
// is called.
class WebRtcSessionDescriptionFactory : public rtc::MessageHandler,
public sigslot::has_slots<> {
public:
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
// Construct with DTLS disabled.
WebRtcSessionDescriptionFactory(rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
WebRtcSession* session,
const std::string& session_id);
// Construct with DTLS enabled using the specified |dtls_identity_store| to
// generate a certificate.
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
WebRtcSession* session,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
const std::string& session_id);
// Construct with DTLS enabled using the specified (already generated)
// |certificate|.
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate,
WebRtcSession* session,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
const std::string& session_id);
virtual ~WebRtcSessionDescriptionFactory();
static void CopyCandidatesFromSessionDescription(
const SessionDescriptionInterface* source_desc,
const std::string& content_name,
SessionDescriptionInterface* dest_desc);
void CreateOffer(
CreateSessionDescriptionObserver* observer,
const PeerConnectionInterface::RTCOfferAnswerOptions& options,
const cricket::MediaSessionOptions& session_options);
void CreateAnswer(CreateSessionDescriptionObserver* observer,
const cricket::MediaSessionOptions& session_options);
void SetSdesPolicy(cricket::SecurePolicy secure_policy);
cricket::SecurePolicy SdesPolicy() const;
sigslot::signal1<const rtc::scoped_refptr<rtc::RTCCertificate>&>
SignalCertificateReady;
// For testing.
bool waiting_for_certificate_for_testing() const {
return certificate_request_state_ == CERTIFICATE_WAITING;
}
private:
enum CertificateRequestState {
CERTIFICATE_NOT_NEEDED,
CERTIFICATE_WAITING,
CERTIFICATE_SUCCEEDED,
CERTIFICATE_FAILED,
};
WebRtcSessionDescriptionFactory(
rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
const rtc::scoped_refptr<WebRtcIdentityRequestObserver>&
identity_request_observer,
WebRtcSession* session,
const std::string& session_id,
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
bool dtls_enabled);
// MessageHandler implementation.
virtual void OnMessage(rtc::Message* msg);
void InternalCreateOffer(CreateSessionDescriptionRequest request);
void InternalCreateAnswer(CreateSessionDescriptionRequest request);
// Posts failure notifications for all pending session description requests.
void FailPendingRequests(const std::string& reason);
void PostCreateSessionDescriptionFailed(
CreateSessionDescriptionObserver* observer,
const std::string& error);
void PostCreateSessionDescriptionSucceeded(
CreateSessionDescriptionObserver* observer,
SessionDescriptionInterface* description);
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
void OnIdentityRequestFailed(int error);
void SetCertificate(
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
std::queue<CreateSessionDescriptionRequest>
create_session_description_requests_;
rtc::Thread* const signaling_thread_;
cricket::TransportDescriptionFactory transport_desc_factory_;
cricket::MediaSessionDescriptionFactory session_desc_factory_;
uint64_t session_version_;
Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (patchset #2 id:20001 of https://codereview.webrtc.org/2013523002/ ) Reason for revert: There are more CreatePeerConnection calls than I anticipated/had found in Chromium, like remoting/protocol/webrtc_transport.cc. Reverting due to broken Chromium FYI bots. Original issue's description: > Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. > > The store was used in WebRtcSessionDescriptionFactory to generate certificates, > now a generator is used instead (new API). PeerConnection[Factory][Interface], > and WebRtcSession are updated to pass generators all the way down to the > WebRtcSessionDescriptionFactory instead of stores. > > The webrtc implementation of a generator, RTCCertificateGenerator, is used as > the default generator (peerconnectionfactory.cc:189) instead of the webrtc > implementation of a store, DtlsIdentityStoreImpl. > The generator is fully parameterized and does not generate RSA-1024 unless you > ask for it (which makes sense not to do beforehand since ECDSA is now default). > The store was not fully parameterized (known filed bug). > > The "top" layer, PeerConnectionFactoryInterface::CreatePeerConnection, is > updated to take a generator instead of a store. But as to not break Chromium, > the old function signature taking a store is kept. It is implemented to invoke > the generator version by wrapping the store in an > RTCCertificateGeneratorStoreWrapper. As soon as Chromium is updated to use the > new function signature we can remove the old CreatePeerConnection. > Due to having multiple CreatePeerConnection signatures, some calling places > are updated to resolve the ambiguity introduced. > > BUG=webrtc:5707, webrtc:5708 > R=phoglund@webrtc.org, tommi@webrtc.org > TBR=tkchin@webrc.org > > Committed: https://chromium.googlesource.com/external/webrtc/+/400781a2091d09a725b32c6953247036b22478e8 TBR=tkchin@webrtc.org,tommi@webrtc.org,phoglund@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5707, webrtc:5708 Review-Url: https://codereview.webrtc.org/2020633002 Cr-Commit-Position: refs/heads/master@{#12948}
2016-05-27 06:08:53 -07:00
const std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store_;
const rtc::scoped_refptr<WebRtcIdentityRequestObserver>
identity_request_observer_;
// TODO(jiayl): remove the dependency on session once bug 2264 is fixed.
WebRtcSession* const session_;
const std::string session_id_;
CertificateRequestState certificate_request_state_;
RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory);
};
} // namespace webrtc
#endif // WEBRTC_API_WEBRTCSESSIONDESCRIPTIONFACTORY_H_