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

Unified Diff: webrtc/p2p/base/fakeportallocator.h

Issue 2053043003: Update ICE role on all ports, not just ones used for new connections. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing issue with call to `erase`. Adding test for port destruction. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/fakeportallocator.h
diff --git a/webrtc/p2p/base/fakeportallocator.h b/webrtc/p2p/base/fakeportallocator.h
index 58e1d5fac67d2e674a37055c3d6b7949b3f0ce97..0bb9c6e66cc3b695b6495d2541a32566e4503569 100644
--- a/webrtc/p2p/base/fakeportallocator.h
+++ b/webrtc/p2p/base/fakeportallocator.h
@@ -132,6 +132,8 @@ class FakePortAllocatorSession : public PortAllocatorSession {
port_.reset(TestUDPPort::Create(worker_thread_, factory_, &network,
network.GetBestIP(), 0, 0, username(),
password(), std::string(), false));
+ port_->SignalDestroyed.connect(
+ this, &FakePortAllocatorSession::OnPortDestroyed);
AddPort(port_.get());
}
++port_config_count_;
@@ -188,6 +190,10 @@ class FakePortAllocatorSession : public PortAllocatorSession {
allocation_done_ = true;
SignalCandidatesAllocationDone(this);
}
+ void OnPortDestroyed(cricket::PortInterface* port) {
+ // Don't want to double-delete port if it deletes itself.
+ port_.release();
+ }
rtc::Thread* worker_thread_;
rtc::PacketSocketFactory* factory_;
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698