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

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

Issue 2264343002: Fixing segfault caused by TurnServer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Using rtc::Bind with method as opposed to lambda. Created 4 years, 4 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/turnserver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/turnserver.h
diff --git a/webrtc/p2p/base/turnserver.h b/webrtc/p2p/base/turnserver.h
index 09b553ef175b314e594ec18a21e5edd7c7f5922b..608e0434e44b08901208885175612f97947e834d 100644
--- a/webrtc/p2p/base/turnserver.h
+++ b/webrtc/p2p/base/turnserver.h
@@ -16,8 +16,10 @@
#include <memory>
#include <set>
#include <string>
+#include <vector>
#include "webrtc/p2p/base/portinterface.h"
+#include "webrtc/base/asyncinvoker.h"
#include "webrtc/base/asyncpacketsocket.h"
#include "webrtc/base/messagequeue.h"
#include "webrtc/base/sigslot.h"
@@ -258,6 +260,9 @@ class TurnServer : public sigslot::has_slots<> {
void OnAllocationDestroyed(TurnServerAllocation* allocation);
void DestroyInternalSocket(rtc::AsyncPacketSocket* socket);
+ // Just clears |sockets_to_delete_|; called asynchronously.
+ void FreeSockets();
+
typedef std::map<rtc::AsyncPacketSocket*,
ProtocolType> InternalSocketMap;
typedef std::map<rtc::AsyncSocket*,
@@ -278,11 +283,15 @@ class TurnServer : public sigslot::has_slots<> {
InternalSocketMap server_sockets_;
ServerSocketMap server_listen_sockets_;
+ // Used when we need to delete a socket asynchronously.
+ std::vector<std::unique_ptr<rtc::AsyncPacketSocket>> sockets_to_delete_;
std::unique_ptr<rtc::PacketSocketFactory> external_socket_factory_;
rtc::SocketAddress external_addr_;
AllocationMap allocations_;
+ rtc::AsyncInvoker invoker_;
+
// For testing only. If this is non-zero, the next NONCE will be generated
// from this value, and it will be reset to 0 after generating the NONCE.
int64_t ts_for_next_nonce_ = 0;
« no previous file with comments | « no previous file | webrtc/p2p/base/turnserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698