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

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

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 6 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
Index: webrtc/p2p/base/transport.h
diff --git a/webrtc/p2p/base/transport.h b/webrtc/p2p/base/transport.h
index 9b6cf519f89106885da65972fd605d1f6beb1766..b582070ca45cbc484a68dff6566ddc45e3214b7d 100644
--- a/webrtc/p2p/base/transport.h
+++ b/webrtc/p2p/base/transport.h
@@ -81,6 +81,16 @@ enum IceGatheringState {
kIceGatheringComplete,
};
+enum ContinualGatheringPolicy {
+ // All port allocator sessions will stop after a writable connection is found.
+ GATHER_ONCE = 0;
+ // The most recent port allocator session will keep on running.
+ GATHER_CONTINUALLY;
+ // The most recent port allocator session will keep on running, and it will
+ // try to recover connectivity if the channel becomes not connected.
+ GATHER_CONTINUALLY_AND_RECOVER;
+};
+
// Stats that we can return about the connections for a transport channel.
// TODO(hta): Rename to ConnectionStats
struct ConnectionInfo {
@@ -158,8 +168,13 @@ struct IceConfig {
// Time interval in milliseconds to ping a backup connection when the ICE
// channel is strongly connected.
int backup_connection_ping_interval = -1;
- // If true, the most recent port allocator session will keep on running.
- bool gather_continually = false;
+
+ ContinualGatheringPolicy gathering_policy = GATHER_ONCE;
+
+ bool gather_continually() {
+ return gathering_policy == GATHER_CONTINUALLY ||
+ gathering_policy == GATHER_CONTINUALLY_AND_RECOVER;
+ }
// Whether we should prioritize Relay/Relay candidate when nothing
// is writable yet.
@@ -170,18 +185,25 @@ struct IceConfig {
// (Default value is a little less than 2 * STRONG_PING_INTERVAL).
int max_strong_interval = -1;
+ // Interval to check on all networks and to perform ICE regathering on any
+ // active network having no connection on it.
+ int regather_on_failed_networks_interval = -1;
+
IceConfig() {}
IceConfig(int receiving_timeout_ms,
int backup_connection_ping_interval,
- bool gather_continually,
+ bool gathering_policy,
bool prioritize_most_likely_candidate_pairs,
- int max_strong_interval_ms)
+ int max_strong_interval_ms,
+ int regather_on_failed_networks_interval_ms)
: receiving_timeout(receiving_timeout_ms),
backup_connection_ping_interval(backup_connection_ping_interval),
- gather_continually(gather_continually),
+ gathering_policy(gathering_policy),
prioritize_most_likely_candidate_pairs(
prioritize_most_likely_candidate_pairs),
- max_strong_interval(max_strong_interval_ms) {}
+ max_strong_interval(max_strong_interval_ms),
+ regather_on_failed_networks_interval(
+ regather_on_failed_networks_interval_ms) {}
};
bool BadTransportDescription(const std::string& desc, std::string* err_desc);

Powered by Google App Engine
This is Rietveld 408576698