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

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

Issue 2176743003: Merge SignalPortPruned with SignalPortsRemoved in PortAllocatorSession (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . 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
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 // Another way of getting the information provided by the signals below. 185 // Another way of getting the information provided by the signals below.
186 // 186 //
187 // Ports and candidates are not guaranteed to be in the same order as the 187 // Ports and candidates are not guaranteed to be in the same order as the
188 // signals were emitted in. 188 // signals were emitted in.
189 virtual std::vector<PortInterface*> ReadyPorts() const = 0; 189 virtual std::vector<PortInterface*> ReadyPorts() const = 0;
190 virtual std::vector<Candidate> ReadyCandidates() const = 0; 190 virtual std::vector<Candidate> ReadyCandidates() const = 0;
191 virtual bool CandidatesAllocationDone() const = 0; 191 virtual bool CandidatesAllocationDone() const = 0;
192 192
193 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; 193 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady;
194 // Ports should be signaled to be removed when the networks of the ports 194 // Fires this signal when the network of the ports failed (either because the
195 // failed (either because the interface is down, or because there is no 195 // interface is down, or because there is no connection on the interface),
196 // connection on the interface). 196 // or when TURN ports are pruned because a higher-priority TURN port becomes
197 // ready(pairable).
197 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&> 198 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&>
198 SignalPortsRemoved; 199 SignalPortsPruned;
199 sigslot::signal2<PortAllocatorSession*, 200 sigslot::signal2<PortAllocatorSession*,
200 const std::vector<Candidate>&> SignalCandidatesReady; 201 const std::vector<Candidate>&> SignalCandidatesReady;
201 // Candidates should be signaled to be removed when the port that generated 202 // Candidates should be signaled to be removed when the port that generated
202 // the candidates is removed. 203 // the candidates is removed.
203 sigslot::signal2<PortAllocatorSession*, const std::vector<Candidate>&> 204 sigslot::signal2<PortAllocatorSession*, const std::vector<Candidate>&>
204 SignalCandidatesRemoved; 205 SignalCandidatesRemoved;
205 sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone; 206 sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone;
206 // A TURN port is pruned if a higher-priority TURN port becomes ready
207 // (pairable). When it is pruned, it will not be used for creating
208 // connections and its candidates will not be sent to the remote side
209 // if they have not been sent.
210 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortPruned;
211 207
212 virtual uint32_t generation() { return generation_; } 208 virtual uint32_t generation() { return generation_; }
213 virtual void set_generation(uint32_t generation) { generation_ = generation; } 209 virtual void set_generation(uint32_t generation) { generation_ = generation; }
214 sigslot::signal1<PortAllocatorSession*> SignalDestroyed; 210 sigslot::signal1<PortAllocatorSession*> SignalDestroyed;
215 211
216 protected: 212 protected:
217 // This method is called when a pooled session (which doesn't have these 213 // This method is called when a pooled session (which doesn't have these
218 // properties initially) is returned by PortAllocator::TakePooledSession, 214 // properties initially) is returned by PortAllocator::TakePooledSession,
219 // and the content name, component, and ICE ufrag/pwd are updated. 215 // and the content name, component, and ICE ufrag/pwd are updated.
220 // 216 //
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // This variable represents the total number of pooled sessions 385 // This variable represents the total number of pooled sessions
390 // both owned by this class and taken by TakePooledSession. 386 // both owned by this class and taken by TakePooledSession.
391 int allocated_pooled_session_count_ = 0; 387 int allocated_pooled_session_count_ = 0;
392 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 388 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
393 bool prune_turn_ports_ = false; 389 bool prune_turn_ports_ = false;
394 }; 390 };
395 391
396 } // namespace cricket 392 } // namespace cricket
397 393
398 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 394 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698