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

Unified Diff: webrtc/api/peerconnectionfactory.cc

Issue 2020633002: Revert of Replacing DtlsIdentityStoreInterface with RTCCertificateGeneratorInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/peerconnectionfactory.h ('k') | webrtc/api/peerconnectionfactoryproxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectionfactory.cc
diff --git a/webrtc/api/peerconnectionfactory.cc b/webrtc/api/peerconnectionfactory.cc
index 9a58452d2d9cccfec1bf6f888f0d0899a574e0be..a91589a98a55343f3bb0ec845337ddb443e05ab6 100644
--- a/webrtc/api/peerconnectionfactory.cc
+++ b/webrtc/api/peerconnectionfactory.cc
@@ -36,27 +36,25 @@
namespace {
-// Passes down the calls to |cert_generator_|. See usage in
-// |CreatePeerConnection|.
-class RTCCertificateGeneratorWrapper
- : public rtc::RTCCertificateGeneratorInterface {
+// Passes down the calls to |store_|. See usage in CreatePeerConnection.
+class DtlsIdentityStoreWrapper : public DtlsIdentityStoreInterface {
public:
- RTCCertificateGeneratorWrapper(
- const rtc::scoped_refptr<RefCountedRTCCertificateGenerator>& cert_gen)
- : cert_generator_(cert_gen) {
- RTC_DCHECK(cert_generator_);
- }
-
- void GenerateCertificateAsync(
+ DtlsIdentityStoreWrapper(
+ const rtc::scoped_refptr<RefCountedDtlsIdentityStore>& store)
+ : store_(store) {
+ RTC_DCHECK(store_);
+ }
+
+ void RequestIdentity(
const rtc::KeyParams& key_params,
const rtc::Optional<uint64_t>& expires_ms,
- const rtc::scoped_refptr<rtc::RTCCertificateGeneratorCallback>& callback)
- override {
- cert_generator_->GenerateCertificateAsync(key_params, expires_ms, callback);
+ const rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>&
+ observer) override {
+ store_->RequestIdentity(key_params, expires_ms, observer);
}
private:
- rtc::scoped_refptr<RefCountedRTCCertificateGenerator> cert_generator_;
+ rtc::scoped_refptr<RefCountedDtlsIdentityStore> store_;
};
} // anonymous namespace
@@ -143,9 +141,9 @@
channel_manager_.reset(nullptr);
// Make sure |worker_thread_| and |signaling_thread_| outlive
- // |cert_generator_|, |default_socket_factory_| and
+ // |dtls_identity_store_|, |default_socket_factory_| and
// |default_network_manager_|.
- cert_generator_ = nullptr;
+ dtls_identity_store_ = nullptr;
default_socket_factory_ = nullptr;
default_network_manager_ = nullptr;
@@ -186,8 +184,8 @@
return false;
}
- cert_generator_ =
- new RefCountedRTCCertificateGenerator(signaling_thread_, network_thread_);
+ dtls_identity_store_ =
+ new RefCountedDtlsIdentityStore(signaling_thread_, network_thread_);
return true;
}
@@ -257,7 +255,7 @@
const PeerConnectionInterface::RTCConfiguration& configuration_in,
const MediaConstraintsInterface* constraints,
std::unique_ptr<cricket::PortAllocator> allocator,
- std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
+ std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
PeerConnectionObserver* observer) {
RTC_DCHECK(signaling_thread_->IsCurrent());
@@ -266,23 +264,23 @@
CopyConstraintsIntoRtcConfiguration(constraints, &configuration);
return CreatePeerConnection(configuration, std::move(allocator),
- std::move(cert_generator), observer);
+ std::move(dtls_identity_store), observer);
}
rtc::scoped_refptr<PeerConnectionInterface>
PeerConnectionFactory::CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
std::unique_ptr<cricket::PortAllocator> allocator,
- std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
+ std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
PeerConnectionObserver* observer) {
RTC_DCHECK(signaling_thread_->IsCurrent());
- if (!cert_generator.get()) {
- // Because |pc|->Initialize takes ownership of the generator we need a new
+ if (!dtls_identity_store.get()) {
+ // Because |pc|->Initialize takes ownership of the store we need a new
// wrapper object that can be deleted without deleting the underlying
- // |cert_generator_|, protecting it from being deleted multiple times.
- cert_generator.reset(
- new RTCCertificateGeneratorWrapper(cert_generator_));
+ // |dtls_identity_store_|, protecting it from being deleted multiple times.
+ dtls_identity_store.reset(
+ new DtlsIdentityStoreWrapper(dtls_identity_store_));
}
if (!allocator) {
@@ -297,7 +295,7 @@
new rtc::RefCountedObject<PeerConnection>(this));
if (!pc->Initialize(configuration, std::move(allocator),
- std::move(cert_generator), observer)) {
+ std::move(dtls_identity_store), observer)) {
return nullptr;
}
return PeerConnectionProxy::Create(signaling_thread(), pc);
« no previous file with comments | « webrtc/api/peerconnectionfactory.h ('k') | webrtc/api/peerconnectionfactoryproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698