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

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

Issue 1415313004: Destroy a Connection if a CreatePermission request fails. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove "friend" relationship between TurnEntry and Connection. Created 5 years, 1 month 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return socket_; 122 return socket_;
123 } 123 }
124 124
125 // Signal with resolved server address. 125 // Signal with resolved server address.
126 // Parameters are port, server address and resolved server address. 126 // Parameters are port, server address and resolved server address.
127 // This signal will be sent only if server address is resolved successfully. 127 // This signal will be sent only if server address is resolved successfully.
128 sigslot::signal3<TurnPort*, 128 sigslot::signal3<TurnPort*,
129 const rtc::SocketAddress&, 129 const rtc::SocketAddress&,
130 const rtc::SocketAddress&> SignalResolvedServerAddress; 130 const rtc::SocketAddress&> SignalResolvedServerAddress;
131 131
132 // This signal is only for testing purpose.
133 sigslot::signal3<TurnPort*, const rtc::SocketAddress&, int> 132 sigslot::signal3<TurnPort*, const rtc::SocketAddress&, int>
134 SignalCreatePermissionResult; 133 SignalCreatePermissionResult;
135 134
136 protected: 135 protected:
137 TurnPort(rtc::Thread* thread, 136 TurnPort(rtc::Thread* thread,
138 rtc::PacketSocketFactory* factory, 137 rtc::PacketSocketFactory* factory,
139 rtc::Network* network, 138 rtc::Network* network,
140 rtc::AsyncPacketSocket* socket, 139 rtc::AsyncPacketSocket* socket,
141 const std::string& username, 140 const std::string& username,
142 const std::string& password, 141 const std::string& password,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 const rtc::PacketOptions& options); 208 const rtc::PacketOptions& options);
210 void UpdateHash(); 209 void UpdateHash();
211 bool UpdateNonce(StunMessage* response); 210 bool UpdateNonce(StunMessage* response);
212 211
213 bool HasPermission(const rtc::IPAddress& ipaddr) const; 212 bool HasPermission(const rtc::IPAddress& ipaddr) const;
214 TurnEntry* FindEntry(const rtc::SocketAddress& address) const; 213 TurnEntry* FindEntry(const rtc::SocketAddress& address) const;
215 TurnEntry* FindEntry(int channel_id) const; 214 TurnEntry* FindEntry(int channel_id) const;
216 TurnEntry* CreateEntry(const rtc::SocketAddress& address); 215 TurnEntry* CreateEntry(const rtc::SocketAddress& address);
217 void DestroyEntry(const rtc::SocketAddress& address); 216 void DestroyEntry(const rtc::SocketAddress& address);
218 void OnConnectionDestroyed(Connection* conn); 217 void OnConnectionDestroyed(Connection* conn);
218 void OnCreatePermissionError(const rtc::SocketAddress address, int code);
219 219
220 ProtocolAddress server_address_; 220 ProtocolAddress server_address_;
221 RelayCredentials credentials_; 221 RelayCredentials credentials_;
222 AttemptedServerSet attempted_server_addresses_; 222 AttemptedServerSet attempted_server_addresses_;
223 223
224 rtc::AsyncPacketSocket* socket_; 224 rtc::AsyncPacketSocket* socket_;
225 SocketOptionsMap socket_options_; 225 SocketOptionsMap socket_options_;
226 rtc::AsyncResolverInterface* resolver_; 226 rtc::AsyncResolverInterface* resolver_;
227 int error_; 227 int error_;
228 228
(...skipping 16 matching lines...) Expand all
245 friend class TurnEntry; 245 friend class TurnEntry;
246 friend class TurnAllocateRequest; 246 friend class TurnAllocateRequest;
247 friend class TurnRefreshRequest; 247 friend class TurnRefreshRequest;
248 friend class TurnCreatePermissionRequest; 248 friend class TurnCreatePermissionRequest;
249 friend class TurnChannelBindRequest; 249 friend class TurnChannelBindRequest;
250 }; 250 };
251 251
252 } // namespace cricket 252 } // namespace cricket
253 253
254 #endif // WEBRTC_P2P_BASE_TURNPORT_H_ 254 #endif // WEBRTC_P2P_BASE_TURNPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698