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

Side by Side Diff: webrtc/p2p/base/turnserver.h

Issue 2114063002: Fixing memory leak in TurnServer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Using std::tie, added unit test. 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 unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/testturnserver.h ('k') | webrtc/p2p/base/turnserver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 rtc::SocketAddress* out) = 0; 154 rtc::SocketAddress* out) = 0;
155 virtual ~TurnRedirectInterface() {} 155 virtual ~TurnRedirectInterface() {}
156 }; 156 };
157 157
158 // The core TURN server class. Give it a socket to listen on via 158 // The core TURN server class. Give it a socket to listen on via
159 // AddInternalServerSocket, and a factory to create external sockets via 159 // AddInternalServerSocket, and a factory to create external sockets via
160 // SetExternalSocketFactory, and it's ready to go. 160 // SetExternalSocketFactory, and it's ready to go.
161 // Not yet wired up: TCP support. 161 // Not yet wired up: TCP support.
162 class TurnServer : public sigslot::has_slots<> { 162 class TurnServer : public sigslot::has_slots<> {
163 public: 163 public:
164 typedef std::map<TurnServerConnection, TurnServerAllocation*> AllocationMap; 164 typedef std::map<TurnServerConnection, std::unique_ptr<TurnServerAllocation>>
165 AllocationMap;
165 166
166 explicit TurnServer(rtc::Thread* thread); 167 explicit TurnServer(rtc::Thread* thread);
167 ~TurnServer(); 168 ~TurnServer();
168 169
169 // Gets/sets the realm value to use for the server. 170 // Gets/sets the realm value to use for the server.
170 const std::string& realm() const { return realm_; } 171 const std::string& realm() const { return realm_; }
171 void set_realm(const std::string& realm) { realm_ = realm; } 172 void set_realm(const std::string& realm) { realm_ = realm; }
172 173
173 // Gets/sets the value for the SOFTWARE attribute for TURN messages. 174 // Gets/sets the value for the SOFTWARE attribute for TURN messages.
174 const std::string& software() const { return software_; } 175 const std::string& software() const { return software_; }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // For testing only. If this is non-zero, the next NONCE will be generated 286 // For testing only. If this is non-zero, the next NONCE will be generated
286 // from this value, and it will be reset to 0 after generating the NONCE. 287 // from this value, and it will be reset to 0 after generating the NONCE.
287 int64_t ts_for_next_nonce_ = 0; 288 int64_t ts_for_next_nonce_ = 0;
288 289
289 friend class TurnServerAllocation; 290 friend class TurnServerAllocation;
290 }; 291 };
291 292
292 } // namespace cricket 293 } // namespace cricket
293 294
294 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_ 295 #endif // WEBRTC_P2P_BASE_TURNSERVER_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/testturnserver.h ('k') | webrtc/p2p/base/turnserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698