Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 601 // Need to detach RTP senders/receivers from WebRtcSession, | 601 // Need to detach RTP senders/receivers from WebRtcSession, |
| 602 // since it's about to be destroyed. | 602 // since it's about to be destroyed. |
| 603 for (const auto& sender : senders_) { | 603 for (const auto& sender : senders_) { |
| 604 sender->internal()->Stop(); | 604 sender->internal()->Stop(); |
| 605 } | 605 } |
| 606 for (const auto& receiver : receivers_) { | 606 for (const auto& receiver : receivers_) { |
| 607 receiver->internal()->Stop(); | 607 receiver->internal()->Stop(); |
| 608 } | 608 } |
| 609 // Destroy stats_ because it depends on session_. | 609 // Destroy stats_ because it depends on session_. |
| 610 stats_.reset(nullptr); | 610 stats_.reset(nullptr); |
| 611 stats_collector_->WaitForPendingRequest(); | |
|
hta-webrtc
2016/12/16 14:05:31
Doing waiting in a destructor makes me itchy. The
hbos
2016/12/16 14:34:52
I'm afraid not, PeerConnectionInterface is referen
hta-webrtc
2016/12/17 19:51:30
OK, the only thing that calls the destructor is th
| |
| 612 stats_collector_ = nullptr; | |
| 611 // Now destroy session_ before destroying other members, | 613 // Now destroy session_ before destroying other members, |
| 612 // because its destruction fires signals (such as VoiceChannelDestroyed) | 614 // because its destruction fires signals (such as VoiceChannelDestroyed) |
| 613 // which will trigger some final actions in PeerConnection... | 615 // which will trigger some final actions in PeerConnection... |
| 614 session_.reset(nullptr); | 616 session_.reset(nullptr); |
| 615 // port_allocator_ lives on the network thread and should be destroyed there. | 617 // port_allocator_ lives on the network thread and should be destroyed there. |
| 616 network_thread()->Invoke<void>(RTC_FROM_HERE, | 618 network_thread()->Invoke<void>(RTC_FROM_HERE, |
| 617 [this] { port_allocator_.reset(nullptr); }); | 619 [this] { port_allocator_.reset(nullptr); }); |
| 618 } | 620 } |
| 619 | 621 |
| 620 bool PeerConnection::Initialize( | 622 bool PeerConnection::Initialize( |
| (...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2400 | 2402 |
| 2401 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2403 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
| 2402 int64_t max_size_bytes) { | 2404 int64_t max_size_bytes) { |
| 2403 return event_log_->StartLogging(file, max_size_bytes); | 2405 return event_log_->StartLogging(file, max_size_bytes); |
| 2404 } | 2406 } |
| 2405 | 2407 |
| 2406 void PeerConnection::StopRtcEventLog_w() { | 2408 void PeerConnection::StopRtcEventLog_w() { |
| 2407 event_log_->StopLogging(); | 2409 event_log_->StopLogging(); |
| 2408 } | 2410 } |
| 2409 } // namespace webrtc | 2411 } // namespace webrtc |
| OLD | NEW |