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

Unified Diff: webrtc/p2p/base/session.cc

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master Created 5 years, 4 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
Index: webrtc/p2p/base/session.cc
diff --git a/webrtc/p2p/base/session.cc b/webrtc/p2p/base/session.cc
index fb8480ee5e347e51234c3d59f5756505ff264e26..4a0a29aa847d5980505adaa9a067cd5adf48fee2 100644
--- a/webrtc/p2p/base/session.cc
+++ b/webrtc/p2p/base/session.cc
@@ -281,9 +281,9 @@ bool TransportProxy::OnRemoteCandidates(const Candidates& candidates,
return true;
}
-void TransportProxy::SetIdentity(
- rtc::SSLIdentity* identity) {
- transport_->get()->SetIdentity(identity);
+void TransportProxy::SetCertificate(
+ const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate) {
+ transport_->get()->SetCertificate(certificate);
}
std::string BaseSession::StateToString(State state) {
@@ -341,7 +341,6 @@ BaseSession::BaseSession(rtc::Thread* signaling_thread,
content_type_(content_type),
transport_type_(NS_GINGLE_P2P),
initiator_(initiator),
- identity_(NULL),
ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10),
ice_tiebreaker_(rtc::CreateRandomId64()),
role_switch_(false),
@@ -395,13 +394,14 @@ const SessionDescription* BaseSession::initiator_description() const {
return initiator_ ? local_description_.get() : remote_description_.get();
}
-bool BaseSession::SetIdentity(rtc::SSLIdentity* identity) {
- if (identity_)
+bool BaseSession::SetCertificate(
+ const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate) {
+ if (certificate_)
return false;
- identity_ = identity;
+ certificate_ = certificate;
for (TransportMap::iterator iter = transports_.begin();
iter != transports_.end(); ++iter) {
- iter->second->SetIdentity(identity_);
+ iter->second->SetCertificate(certificate_);
}
return true;
}
@@ -548,8 +548,8 @@ TransportProxy* BaseSession::GetOrCreateTransportProxy(
new TransportWrapper(transport));
transproxy->SignalCandidatesReady.connect(
this, &BaseSession::OnTransportProxyCandidatesReady);
- if (identity_)
- transproxy->SetIdentity(identity_);
+ if (certificate_)
+ transproxy->SetCertificate(certificate_);
transports_[content_name] = transproxy;
return transproxy;
@@ -581,7 +581,7 @@ Transport* BaseSession::CreateTransport(const std::string& content_name) {
ASSERT(transport_type_ == NS_GINGLE_P2P);
Transport* transport = new DtlsTransport<P2PTransport>(
signaling_thread(), worker_thread(), content_name, port_allocator(),
- identity_);
+ certificate_);
transport->SetChannelReceivingTimeout(ice_receiving_timeout_);
return transport;
}

Powered by Google App Engine
This is Rietveld 408576698