Index: webrtc/p2p/base/session.cc |
diff --git a/webrtc/p2p/base/session.cc b/webrtc/p2p/base/session.cc |
index 6c185113f9226e0d5bc9b4e48832fe7cc2805aa4..23680b9be83b858ab7c8a19127e73e4510adfb6b 100644 |
--- a/webrtc/p2p/base/session.cc |
+++ b/webrtc/p2p/base/session.cc |
@@ -277,9 +277,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<rtc::RTCCertificate>& certificate) { |
+ transport_->get()->SetCertificate(certificate); |
} |
std::string BaseSession::StateToString(State state) { |
@@ -336,7 +336,6 @@ BaseSession::BaseSession(rtc::Thread* signaling_thread, |
sid_(sid), |
content_type_(content_type), |
initiator_(initiator), |
- identity_(NULL), |
ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10), |
ice_tiebreaker_(rtc::CreateRandomId64()), |
role_switch_(false), |
@@ -390,13 +389,16 @@ 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<rtc::RTCCertificate>& certificate) { |
+ if (certificate_) |
return false; |
- identity_ = identity; |
+ if (!certificate) |
+ return false; |
+ certificate_ = certificate; |
for (TransportMap::iterator iter = transports_.begin(); |
iter != transports_.end(); ++iter) { |
- iter->second->SetIdentity(identity_); |
+ iter->second->SetCertificate(certificate_); |
} |
return true; |
} |
@@ -543,8 +545,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; |
@@ -575,7 +577,7 @@ void BaseSession::DestroyTransportProxy( |
Transport* BaseSession::CreateTransport(const std::string& content_name) { |
Transport* transport = new DtlsTransport<P2PTransport>( |
signaling_thread(), worker_thread(), content_name, port_allocator(), |
- identity_); |
+ certificate_); |
transport->SetChannelReceivingTimeout(ice_receiving_timeout_); |
return transport; |
} |