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

Unified Diff: webrtc/base/virtualsocketserver.h

Issue 2261523004: Signal to remove remote candidates if ports are pruned. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Revised tests to include different delay cases. Created 4 years, 3 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/base/virtualsocketserver.cc » ('j') | webrtc/p2p/client/basicportallocator_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/virtualsocketserver.h
diff --git a/webrtc/base/virtualsocketserver.h b/webrtc/base/virtualsocketserver.h
index cce0279d32e2a786970ab9370545ea46e9033e22..0d34ed70c95848341d3dcca5c024b7b93d07b2e7 100644
--- a/webrtc/base/virtualsocketserver.h
+++ b/webrtc/base/virtualsocketserver.h
@@ -112,6 +112,11 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
bool Wait(int cms, bool process_io) override;
void WakeUp() override;
+ void SetDelayOnSocketAddress(const rtc::SocketAddress& address,
+ int delay_ms) {
+ delays_[address] = delay_ms;
+ }
+
typedef std::pair<double, double> Point;
typedef std::vector<Point> Function;
@@ -194,8 +199,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
// Computes the number of milliseconds required to send a packet of this size.
uint32_t SendDelay(uint32_t size);
- // Returns a random transit delay chosen from the appropriate distribution.
- uint32_t GetRandomTransitDelay();
+ // If the delay has been set for the address of the socket, returns the set
+ // delay. Otherwise, returns a random transit delay chosen from the
+ // appropriate distribution.
+ uint32_t GetTransitDelay(Socket* socket);
// Basic operations on functions. Those that return a function also take
// ownership of the function given (and hence, may modify or delete it).
@@ -260,7 +267,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
uint32_t delay_mean_;
uint32_t delay_stddev_;
uint32_t delay_samples_;
- Function* delay_dist_;
+
+ std::map<rtc::SocketAddress, int> delays_;
+ std::unique_ptr<Function> delay_dist_;
+
CriticalSection delay_crit_;
double drop_prob_;
« no previous file with comments | « no previous file | webrtc/base/virtualsocketserver.cc » ('j') | webrtc/p2p/client/basicportallocator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698