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

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 1975453002: Add PeerConnection IsClosed check. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change the webrtcsession constructor. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 << "."; 450 << ".";
451 return true; 451 return true;
452 } 452 }
453 return false; 453 return false;
454 } 454 }
455 455
456 WebRtcSession::WebRtcSession(webrtc::MediaControllerInterface* media_controller, 456 WebRtcSession::WebRtcSession(webrtc::MediaControllerInterface* media_controller,
457 rtc::Thread* network_thread, 457 rtc::Thread* network_thread,
458 rtc::Thread* worker_thread, 458 rtc::Thread* worker_thread,
459 rtc::Thread* signaling_thread, 459 rtc::Thread* signaling_thread,
460 cricket::PortAllocator* port_allocator) 460 cricket::PortAllocator* port_allocator,
461 cricket::TransportController* transport_controller)
461 : worker_thread_(worker_thread), 462 : worker_thread_(worker_thread),
462 signaling_thread_(signaling_thread), 463 signaling_thread_(signaling_thread),
463 // RFC 3264: The numeric value of the session id and version in the 464 // RFC 3264: The numeric value of the session id and version in the
464 // o line MUST be representable with a "64 bit signed integer". 465 // o line MUST be representable with a "64 bit signed integer".
465 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. 466 // Due to this constraint session id |sid_| is max limited to LLONG_MAX.
466 sid_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)), 467 sid_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)),
467 transport_controller_(new cricket::TransportController(signaling_thread,
468 network_thread,
469 port_allocator)),
470 media_controller_(media_controller), 468 media_controller_(media_controller),
471 channel_manager_(media_controller_->channel_manager()), 469 channel_manager_(media_controller_->channel_manager()),
472 ice_observer_(NULL), 470 ice_observer_(NULL),
473 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), 471 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew),
474 ice_connection_receiving_(true), 472 ice_connection_receiving_(true),
475 older_version_remote_peer_(false), 473 older_version_remote_peer_(false),
476 dtls_enabled_(false), 474 dtls_enabled_(false),
477 data_channel_type_(cricket::DCT_NONE), 475 data_channel_type_(cricket::DCT_NONE),
478 metrics_observer_(NULL) { 476 metrics_observer_(NULL) {
477 transport_controller_.reset(transport_controller);
honghaiz3 2016/06/23 18:36:02 Could this be assigned in the argument list above?
Taylor Brandstetter 2016/06/23 19:42:17 Agreed. Also, it would be slightly better if the a
Zhi Huang 2016/07/11 21:41:20 Done.
479 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED); 478 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED);
480 transport_controller_->SignalConnectionState.connect( 479 transport_controller_->SignalConnectionState.connect(
481 this, &WebRtcSession::OnTransportControllerConnectionState); 480 this, &WebRtcSession::OnTransportControllerConnectionState);
482 transport_controller_->SignalReceiving.connect( 481 transport_controller_->SignalReceiving.connect(
483 this, &WebRtcSession::OnTransportControllerReceiving); 482 this, &WebRtcSession::OnTransportControllerReceiving);
484 transport_controller_->SignalGatheringState.connect( 483 transport_controller_->SignalGatheringState.connect(
485 this, &WebRtcSession::OnTransportControllerGatheringState); 484 this, &WebRtcSession::OnTransportControllerGatheringState);
486 transport_controller_->SignalCandidatesGathered.connect( 485 transport_controller_->SignalCandidatesGathered.connect(
487 this, &WebRtcSession::OnTransportControllerCandidatesGathered); 486 this, &WebRtcSession::OnTransportControllerCandidatesGathered);
488 transport_controller_->SignalCandidatesRemoved.connect( 487 transport_controller_->SignalCandidatesRemoved.connect(
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 ssl_cipher_suite); 2160 ssl_cipher_suite);
2162 } 2161 }
2163 } 2162 }
2164 2163
2165 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { 2164 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) {
2166 RTC_DCHECK(worker_thread()->IsCurrent()); 2165 RTC_DCHECK(worker_thread()->IsCurrent());
2167 media_controller_->call_w()->OnSentPacket(sent_packet); 2166 media_controller_->call_w()->OnSentPacket(sent_packet);
2168 } 2167 }
2169 2168
2170 } // namespace webrtc 2169 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698