OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 MediaSessionOptions::Streams sorted_streams = streams; | 61 MediaSessionOptions::Streams sorted_streams = streams; |
62 std::sort(sorted_streams.begin(), sorted_streams.end(), CompareStream); | 62 std::sort(sorted_streams.begin(), sorted_streams.end(), CompareStream); |
63 MediaSessionOptions::Streams::iterator it = | 63 MediaSessionOptions::Streams::iterator it = |
64 std::adjacent_find(sorted_streams.begin(), sorted_streams.end(), | 64 std::adjacent_find(sorted_streams.begin(), sorted_streams.end(), |
65 SameId); | 65 SameId); |
66 return it == sorted_streams.end(); | 66 return it == sorted_streams.end(); |
67 } | 67 } |
68 | 68 |
69 enum { | 69 enum { |
70 MSG_CREATE_SESSIONDESCRIPTION_SUCCESS, | 70 MSG_CREATE_SESSIONDESCRIPTION_SUCCESS, |
71 MSG_CREATE_SESSIONDESCRIPTION_FAILED | 71 MSG_CREATE_SESSIONDESCRIPTION_FAILED, |
72 MSG_USE_CONSTRUCTOR_CERTIFICATE | |
72 }; | 73 }; |
73 | 74 |
74 struct CreateSessionDescriptionMsg : public rtc::MessageData { | 75 struct CreateSessionDescriptionMsg : public rtc::MessageData { |
75 explicit CreateSessionDescriptionMsg( | 76 explicit CreateSessionDescriptionMsg( |
76 webrtc::CreateSessionDescriptionObserver* observer) | 77 webrtc::CreateSessionDescriptionObserver* observer) |
77 : observer(observer) { | 78 : observer(observer) { |
78 } | 79 } |
79 | 80 |
80 rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserver> observer; | 81 rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserver> observer; |
81 std::string error; | 82 std::string error; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 source_desc->candidates(m); | 120 source_desc->candidates(m); |
120 const IceCandidateCollection* dest_candidates = dest_desc->candidates(m); | 121 const IceCandidateCollection* dest_candidates = dest_desc->candidates(m); |
121 for (size_t n = 0; n < source_candidates->count(); ++n) { | 122 for (size_t n = 0; n < source_candidates->count(); ++n) { |
122 const IceCandidateInterface* new_candidate = source_candidates->at(n); | 123 const IceCandidateInterface* new_candidate = source_candidates->at(n); |
123 if (!dest_candidates->HasCandidate(new_candidate)) | 124 if (!dest_candidates->HasCandidate(new_candidate)) |
124 dest_desc->AddCandidate(source_candidates->at(n)); | 125 dest_desc->AddCandidate(source_candidates->at(n)); |
125 } | 126 } |
126 } | 127 } |
127 } | 128 } |
128 | 129 |
130 // Private constructor called by other constructors. | |
129 WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( | 131 WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( |
130 rtc::Thread* signaling_thread, | 132 rtc::Thread* signaling_thread, |
131 cricket::ChannelManager* channel_manager, | 133 cricket::ChannelManager* channel_manager, |
132 MediaStreamSignaling* mediastream_signaling, | 134 MediaStreamSignaling* mediastream_signaling, |
133 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 135 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
134 WebRtcSession* session, | 136 WebRtcSession* session, |
135 const std::string& session_id, | 137 const std::string& session_id, |
136 cricket::DataChannelType dct, | 138 cricket::DataChannelType dct, |
137 bool dtls_enabled) | 139 bool dtls_enabled) |
138 : signaling_thread_(signaling_thread), | 140 : signaling_thread_(signaling_thread), |
139 mediastream_signaling_(mediastream_signaling), | 141 mediastream_signaling_(mediastream_signaling), |
140 session_desc_factory_(channel_manager, &transport_desc_factory_), | 142 session_desc_factory_(channel_manager, &transport_desc_factory_), |
141 // RFC 4566 suggested a Network Time Protocol (NTP) format timestamp | 143 // RFC 4566 suggested a Network Time Protocol (NTP) format timestamp |
142 // as the session id and session version. To simplify, it should be fine | 144 // as the session id and session version. To simplify, it should be fine |
143 // to just use a random number as session id and start version from | 145 // to just use a random number as session id and start version from |
144 // |kInitSessionVersion|. | 146 // |kInitSessionVersion|. |
145 session_version_(kInitSessionVersion), | 147 session_version_(kInitSessionVersion), |
146 dtls_identity_store_(dtls_identity_store.Pass()), | 148 dtls_identity_store_(dtls_identity_store.Pass()), |
147 session_(session), | 149 session_(session), |
148 session_id_(session_id), | 150 session_id_(session_id), |
149 data_channel_type_(dct), | 151 data_channel_type_(dct), |
150 identity_request_state_(IDENTITY_NOT_NEEDED) { | 152 certificate_request_state_(CERTIFICATE_NOT_NEEDED) { |
151 session_desc_factory_.set_add_legacy_streams(false); | 153 session_desc_factory_.set_add_legacy_streams(false); |
152 // SRTP-SDES is disabled if DTLS is on. | 154 // SRTP-SDES is disabled if DTLS is on. |
153 SetSdesPolicy(dtls_enabled ? cricket::SEC_DISABLED : cricket::SEC_REQUIRED); | 155 SetSdesPolicy(dtls_enabled ? cricket::SEC_DISABLED : cricket::SEC_REQUIRED); |
156 } | |
154 | 157 |
155 // If |dtls_enabled| we must have a |dtls_identity_store_|. | 158 WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( |
156 DCHECK(!dtls_enabled || dtls_identity_store_); | 159 rtc::Thread* signaling_thread, |
160 cricket::ChannelManager* channel_manager, | |
161 MediaStreamSignaling* mediastream_signaling, | |
162 WebRtcSession* session, | |
163 const std::string& session_id, | |
164 cricket::DataChannelType dct) | |
165 : WebRtcSessionDescriptionFactory( | |
166 signaling_thread, channel_manager, mediastream_signaling, nullptr, | |
167 session, session_id, dct, false) { | |
168 LOG(LS_VERBOSE) << "DTLS-SRTP disabled."; | |
169 } | |
157 | 170 |
158 if (dtls_enabled && dtls_identity_store_) { | 171 WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( |
159 identity_request_observer_ = | 172 rtc::Thread* signaling_thread, |
160 new rtc::RefCountedObject<WebRtcIdentityRequestObserver>(); | 173 cricket::ChannelManager* channel_manager, |
174 MediaStreamSignaling* mediastream_signaling, | |
175 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | |
176 WebRtcSession* session, | |
177 const std::string& session_id, | |
178 cricket::DataChannelType dct) | |
179 : WebRtcSessionDescriptionFactory( | |
180 signaling_thread, channel_manager, mediastream_signaling, | |
181 dtls_identity_store.Pass(), session, session_id, dct, true) { | |
182 DCHECK(dtls_identity_store_); | |
161 | 183 |
162 identity_request_observer_->SignalRequestFailed.connect( | 184 certificate_request_state_ = CERTIFICATE_WAITING; |
163 this, &WebRtcSessionDescriptionFactory::OnIdentityRequestFailed); | |
164 identity_request_observer_->SignalIdentityReady.connect( | |
165 this, &WebRtcSessionDescriptionFactory::SetIdentity); | |
166 | 185 |
167 LOG(LS_VERBOSE) << "DTLS-SRTP enabled; sending DTLS identity request."; | 186 identity_request_observer_ = |
168 identity_request_state_ = IDENTITY_WAITING; | 187 new rtc::RefCountedObject<WebRtcIdentityRequestObserver>(); |
tommi
2015/08/20 14:58:11
initialize in the initializer list?
hbos
2015/08/20 16:06:11
Done. This required moving it to helper constructo
| |
169 dtls_identity_store_->RequestIdentity(rtc::KT_DEFAULT, | 188 identity_request_observer_->SignalRequestFailed.connect( |
170 identity_request_observer_); | 189 this, &WebRtcSessionDescriptionFactory::OnIdentityRequestFailed); |
171 } | 190 identity_request_observer_->SignalIdentityReady.connect( |
191 this, &WebRtcSessionDescriptionFactory::SetIdentity); | |
192 | |
193 rtc::KeyType key_type = rtc::KT_DEFAULT; | |
194 LOG(LS_VERBOSE) << "DTLS-SRTP enabled; sending DTLS identity request (key " | |
195 << "type: " << key_type << ")."; | |
196 | |
197 // Request identity. This happens asynchronously, so the caller will have a | |
198 // chance to connect to SignalIdentityReady. | |
199 dtls_identity_store_->RequestIdentity(key_type, identity_request_observer_); | |
200 } | |
201 | |
202 WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( | |
203 rtc::Thread* signaling_thread, | |
204 cricket::ChannelManager* channel_manager, | |
205 MediaStreamSignaling* mediastream_signaling, | |
206 rtc::scoped_refptr<rtc::RTCCertificate> certificate, | |
207 WebRtcSession* session, | |
208 const std::string& session_id, | |
209 cricket::DataChannelType dct) | |
210 : WebRtcSessionDescriptionFactory( | |
211 signaling_thread, channel_manager, mediastream_signaling, nullptr, | |
212 session, session_id, dct, true) { | |
213 DCHECK(certificate); | |
214 | |
215 certificate_request_state_ = CERTIFICATE_WAITING; | |
216 | |
217 LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter."; | |
218 // We already have a certificate but we wait to do SetIdentity; if we do | |
219 // it in the constructor then the caller has not had a chance to connect to | |
220 // SignalIdentityReady. | |
221 signaling_thread_->Post(this, MSG_USE_CONSTRUCTOR_CERTIFICATE, | |
222 new rtc::ScopedRefMessageData<rtc::RTCCertificate>( | |
223 certificate)); | |
172 } | 224 } |
173 | 225 |
174 WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory() { | 226 WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory() { |
175 ASSERT(signaling_thread_->IsCurrent()); | 227 ASSERT(signaling_thread_->IsCurrent()); |
176 | 228 |
177 // Fail any requests that were asked for before identity generation completed. | 229 // Fail any requests that were asked for before identity generation completed. |
178 FailPendingRequests(kFailedDueToSessionShutdown); | 230 FailPendingRequests(kFailedDueToSessionShutdown); |
179 | 231 |
180 // Process all pending notifications in the message queue. If we don't do | 232 // Process all pending notifications in the message queue. If we don't do |
181 // this, requests will linger and not know they succeeded or failed. | 233 // this, requests will linger and not know they succeeded or failed. |
182 rtc::MessageList list; | 234 rtc::MessageList list; |
183 signaling_thread_->Clear(this, rtc::MQID_ANY, &list); | 235 signaling_thread_->Clear(this, rtc::MQID_ANY, &list); |
184 for (auto& msg : list) | 236 for (auto& msg : list) |
185 OnMessage(&msg); | 237 OnMessage(&msg); |
186 | 238 |
187 transport_desc_factory_.set_identity(NULL); | 239 transport_desc_factory_.set_identity(NULL); |
188 } | 240 } |
189 | 241 |
190 void WebRtcSessionDescriptionFactory::CreateOffer( | 242 void WebRtcSessionDescriptionFactory::CreateOffer( |
191 CreateSessionDescriptionObserver* observer, | 243 CreateSessionDescriptionObserver* observer, |
192 const PeerConnectionInterface::RTCOfferAnswerOptions& options) { | 244 const PeerConnectionInterface::RTCOfferAnswerOptions& options) { |
193 cricket::MediaSessionOptions session_options; | 245 cricket::MediaSessionOptions session_options; |
194 | 246 |
195 std::string error = "CreateOffer"; | 247 std::string error = "CreateOffer"; |
196 if (identity_request_state_ == IDENTITY_FAILED) { | 248 if (certificate_request_state_ == CERTIFICATE_FAILED) { |
197 error += kFailedDueToIdentityFailed; | 249 error += kFailedDueToIdentityFailed; |
198 LOG(LS_ERROR) << error; | 250 LOG(LS_ERROR) << error; |
199 PostCreateSessionDescriptionFailed(observer, error); | 251 PostCreateSessionDescriptionFailed(observer, error); |
200 return; | 252 return; |
201 } | 253 } |
202 | 254 |
203 if (!mediastream_signaling_->GetOptionsForOffer(options, | 255 if (!mediastream_signaling_->GetOptionsForOffer(options, |
204 &session_options)) { | 256 &session_options)) { |
205 error += " called with invalid options."; | 257 error += " called with invalid options."; |
206 LOG(LS_ERROR) << error; | 258 LOG(LS_ERROR) << error; |
207 PostCreateSessionDescriptionFailed(observer, error); | 259 PostCreateSessionDescriptionFailed(observer, error); |
208 return; | 260 return; |
209 } | 261 } |
210 | 262 |
211 if (!ValidStreams(session_options.streams)) { | 263 if (!ValidStreams(session_options.streams)) { |
212 error += " called with invalid media streams."; | 264 error += " called with invalid media streams."; |
213 LOG(LS_ERROR) << error; | 265 LOG(LS_ERROR) << error; |
214 PostCreateSessionDescriptionFailed(observer, error); | 266 PostCreateSessionDescriptionFailed(observer, error); |
215 return; | 267 return; |
216 } | 268 } |
217 | 269 |
218 if (data_channel_type_ == cricket::DCT_SCTP && | 270 if (data_channel_type_ == cricket::DCT_SCTP && |
219 mediastream_signaling_->HasDataChannels()) { | 271 mediastream_signaling_->HasDataChannels()) { |
220 session_options.data_channel_type = cricket::DCT_SCTP; | 272 session_options.data_channel_type = cricket::DCT_SCTP; |
221 } | 273 } |
222 | 274 |
223 CreateSessionDescriptionRequest request( | 275 CreateSessionDescriptionRequest request( |
224 CreateSessionDescriptionRequest::kOffer, observer, session_options); | 276 CreateSessionDescriptionRequest::kOffer, observer, session_options); |
225 if (identity_request_state_ == IDENTITY_WAITING) { | 277 if (certificate_request_state_ == CERTIFICATE_WAITING) { |
226 create_session_description_requests_.push(request); | 278 create_session_description_requests_.push(request); |
227 } else { | 279 } else { |
228 ASSERT(identity_request_state_ == IDENTITY_SUCCEEDED || | 280 ASSERT(certificate_request_state_ == CERTIFICATE_SUCCEEDED || |
229 identity_request_state_ == IDENTITY_NOT_NEEDED); | 281 certificate_request_state_ == CERTIFICATE_NOT_NEEDED); |
230 InternalCreateOffer(request); | 282 InternalCreateOffer(request); |
231 } | 283 } |
232 } | 284 } |
233 | 285 |
234 void WebRtcSessionDescriptionFactory::CreateAnswer( | 286 void WebRtcSessionDescriptionFactory::CreateAnswer( |
235 CreateSessionDescriptionObserver* observer, | 287 CreateSessionDescriptionObserver* observer, |
236 const MediaConstraintsInterface* constraints) { | 288 const MediaConstraintsInterface* constraints) { |
237 std::string error = "CreateAnswer"; | 289 std::string error = "CreateAnswer"; |
238 if (identity_request_state_ == IDENTITY_FAILED) { | 290 if (certificate_request_state_ == CERTIFICATE_FAILED) { |
239 error += kFailedDueToIdentityFailed; | 291 error += kFailedDueToIdentityFailed; |
240 LOG(LS_ERROR) << error; | 292 LOG(LS_ERROR) << error; |
241 PostCreateSessionDescriptionFailed(observer, error); | 293 PostCreateSessionDescriptionFailed(observer, error); |
242 return; | 294 return; |
243 } | 295 } |
244 if (!session_->remote_description()) { | 296 if (!session_->remote_description()) { |
245 error += " can't be called before SetRemoteDescription."; | 297 error += " can't be called before SetRemoteDescription."; |
246 LOG(LS_ERROR) << error; | 298 LOG(LS_ERROR) << error; |
247 PostCreateSessionDescriptionFailed(observer, error); | 299 PostCreateSessionDescriptionFailed(observer, error); |
248 return; | 300 return; |
(...skipping 21 matching lines...) Expand all Loading... | |
270 } | 322 } |
271 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams | 323 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams |
272 // are not signaled in the SDP so does not go through that path and must be | 324 // are not signaled in the SDP so does not go through that path and must be |
273 // handled here. | 325 // handled here. |
274 if (data_channel_type_ == cricket::DCT_SCTP) { | 326 if (data_channel_type_ == cricket::DCT_SCTP) { |
275 options.data_channel_type = cricket::DCT_SCTP; | 327 options.data_channel_type = cricket::DCT_SCTP; |
276 } | 328 } |
277 | 329 |
278 CreateSessionDescriptionRequest request( | 330 CreateSessionDescriptionRequest request( |
279 CreateSessionDescriptionRequest::kAnswer, observer, options); | 331 CreateSessionDescriptionRequest::kAnswer, observer, options); |
280 if (identity_request_state_ == IDENTITY_WAITING) { | 332 if (certificate_request_state_ == CERTIFICATE_WAITING) { |
281 create_session_description_requests_.push(request); | 333 create_session_description_requests_.push(request); |
282 } else { | 334 } else { |
283 ASSERT(identity_request_state_ == IDENTITY_SUCCEEDED || | 335 ASSERT(certificate_request_state_ == CERTIFICATE_SUCCEEDED || |
284 identity_request_state_ == IDENTITY_NOT_NEEDED); | 336 certificate_request_state_ == CERTIFICATE_NOT_NEEDED); |
285 InternalCreateAnswer(request); | 337 InternalCreateAnswer(request); |
286 } | 338 } |
287 } | 339 } |
288 | 340 |
289 void WebRtcSessionDescriptionFactory::SetSdesPolicy( | 341 void WebRtcSessionDescriptionFactory::SetSdesPolicy( |
290 cricket::SecurePolicy secure_policy) { | 342 cricket::SecurePolicy secure_policy) { |
291 session_desc_factory_.set_secure(secure_policy); | 343 session_desc_factory_.set_secure(secure_policy); |
292 } | 344 } |
293 | 345 |
294 cricket::SecurePolicy WebRtcSessionDescriptionFactory::SdesPolicy() const { | 346 cricket::SecurePolicy WebRtcSessionDescriptionFactory::SdesPolicy() const { |
295 return session_desc_factory_.secure(); | 347 return session_desc_factory_.secure(); |
296 } | 348 } |
297 | 349 |
298 void WebRtcSessionDescriptionFactory::OnMessage(rtc::Message* msg) { | 350 void WebRtcSessionDescriptionFactory::OnMessage(rtc::Message* msg) { |
299 switch (msg->message_id) { | 351 switch (msg->message_id) { |
300 case MSG_CREATE_SESSIONDESCRIPTION_SUCCESS: { | 352 case MSG_CREATE_SESSIONDESCRIPTION_SUCCESS: { |
301 CreateSessionDescriptionMsg* param = | 353 CreateSessionDescriptionMsg* param = |
302 static_cast<CreateSessionDescriptionMsg*>(msg->pdata); | 354 static_cast<CreateSessionDescriptionMsg*>(msg->pdata); |
303 param->observer->OnSuccess(param->description.release()); | 355 param->observer->OnSuccess(param->description.release()); |
304 delete param; | 356 delete param; |
305 break; | 357 break; |
306 } | 358 } |
307 case MSG_CREATE_SESSIONDESCRIPTION_FAILED: { | 359 case MSG_CREATE_SESSIONDESCRIPTION_FAILED: { |
308 CreateSessionDescriptionMsg* param = | 360 CreateSessionDescriptionMsg* param = |
309 static_cast<CreateSessionDescriptionMsg*>(msg->pdata); | 361 static_cast<CreateSessionDescriptionMsg*>(msg->pdata); |
310 param->observer->OnFailure(param->error); | 362 param->observer->OnFailure(param->error); |
311 delete param; | 363 delete param; |
312 break; | 364 break; |
313 } | 365 } |
366 case MSG_USE_CONSTRUCTOR_CERTIFICATE: { | |
367 rtc::ScopedRefMessageData<rtc::RTCCertificate>* param = | |
368 static_cast<rtc::ScopedRefMessageData<rtc::RTCCertificate>*>( | |
369 msg->pdata); | |
370 LOG(LS_INFO) << "Using certificate supplied to the constructor."; | |
371 // TODO(hbos): Pass around scoped_refptr<RTCCertificate> instead of | |
372 // SSLIdentity* (then there will be no need to do GetReference here). | |
373 SetIdentity(param->data()->identity()->GetReference()); | |
374 delete param; | |
375 break; | |
376 } | |
314 default: | 377 default: |
315 ASSERT(false); | 378 ASSERT(false); |
316 break; | 379 break; |
317 } | 380 } |
318 } | 381 } |
319 | 382 |
320 void WebRtcSessionDescriptionFactory::InternalCreateOffer( | 383 void WebRtcSessionDescriptionFactory::InternalCreateOffer( |
321 CreateSessionDescriptionRequest request) { | 384 CreateSessionDescriptionRequest request) { |
322 cricket::SessionDescription* desc( | 385 cricket::SessionDescription* desc( |
323 session_desc_factory_.CreateOffer( | 386 session_desc_factory_.CreateOffer( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 SessionDescriptionInterface* description) { | 485 SessionDescriptionInterface* description) { |
423 CreateSessionDescriptionMsg* msg = new CreateSessionDescriptionMsg(observer); | 486 CreateSessionDescriptionMsg* msg = new CreateSessionDescriptionMsg(observer); |
424 msg->description.reset(description); | 487 msg->description.reset(description); |
425 signaling_thread_->Post(this, MSG_CREATE_SESSIONDESCRIPTION_SUCCESS, msg); | 488 signaling_thread_->Post(this, MSG_CREATE_SESSIONDESCRIPTION_SUCCESS, msg); |
426 } | 489 } |
427 | 490 |
428 void WebRtcSessionDescriptionFactory::OnIdentityRequestFailed(int error) { | 491 void WebRtcSessionDescriptionFactory::OnIdentityRequestFailed(int error) { |
429 ASSERT(signaling_thread_->IsCurrent()); | 492 ASSERT(signaling_thread_->IsCurrent()); |
430 | 493 |
431 LOG(LS_ERROR) << "Async identity request failed: error = " << error; | 494 LOG(LS_ERROR) << "Async identity request failed: error = " << error; |
432 identity_request_state_ = IDENTITY_FAILED; | 495 certificate_request_state_ = CERTIFICATE_FAILED; |
433 | 496 |
434 FailPendingRequests(kFailedDueToIdentityFailed); | 497 FailPendingRequests(kFailedDueToIdentityFailed); |
435 } | 498 } |
436 | 499 |
437 void WebRtcSessionDescriptionFactory::SetIdentity( | 500 void WebRtcSessionDescriptionFactory::SetIdentity( |
438 rtc::SSLIdentity* identity) { | 501 rtc::SSLIdentity* identity) { |
439 LOG(LS_VERBOSE) << "Setting new identity"; | 502 LOG(LS_VERBOSE) << "Setting new identity"; |
440 | 503 |
441 identity_request_state_ = IDENTITY_SUCCEEDED; | 504 certificate_request_state_ = CERTIFICATE_SUCCEEDED; |
442 SignalIdentityReady(identity); | 505 SignalIdentityReady(identity); |
443 | 506 |
444 transport_desc_factory_.set_identity(identity); | 507 transport_desc_factory_.set_identity(identity); |
445 transport_desc_factory_.set_secure(cricket::SEC_ENABLED); | 508 transport_desc_factory_.set_secure(cricket::SEC_ENABLED); |
446 | 509 |
447 while (!create_session_description_requests_.empty()) { | 510 while (!create_session_description_requests_.empty()) { |
448 if (create_session_description_requests_.front().type == | 511 if (create_session_description_requests_.front().type == |
449 CreateSessionDescriptionRequest::kOffer) { | 512 CreateSessionDescriptionRequest::kOffer) { |
450 InternalCreateOffer(create_session_description_requests_.front()); | 513 InternalCreateOffer(create_session_description_requests_.front()); |
451 } else { | 514 } else { |
452 InternalCreateAnswer(create_session_description_requests_.front()); | 515 InternalCreateAnswer(create_session_description_requests_.front()); |
453 } | 516 } |
454 create_session_description_requests_.pop(); | 517 create_session_description_requests_.pop(); |
455 } | 518 } |
456 } | 519 } |
457 } // namespace webrtc | 520 } // namespace webrtc |
OLD | NEW |