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

Unified Diff: remoting/protocol/ice_transport_channel.cc

Issue 1687543002: Fix IceTransportTest.TestBrokenTransport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | remoting/protocol/ice_transport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ice_transport_channel.cc
diff --git a/remoting/protocol/ice_transport_channel.cc b/remoting/protocol/ice_transport_channel.cc
index a7ab222e14891140d8ff0b1e69ce475a86dac64b..78e5c8372146b4dda5bdff4b1a0951a97f2acc7b 100644
--- a/remoting/protocol/ice_transport_channel.cc
+++ b/remoting/protocol/ice_transport_channel.cc
@@ -27,10 +27,6 @@ namespace protocol {
namespace {
-// Try connecting ICE twice with timeout of 15 seconds for each attempt.
-const int kMaxReconnectAttempts = 2;
-const int kReconnectDelaySeconds = 15;
-
// Utility function to map a cricket::Candidate string type to a
// TransportRoute::RouteType enum value.
TransportRoute::RouteType CandidateTypeToTransportRouteType(
@@ -54,7 +50,8 @@ IceTransportChannel::IceTransportChannel(
: transport_context_(transport_context),
ice_username_fragment_(
rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH)),
- connect_attempts_left_(kMaxReconnectAttempts),
+ connect_attempts_left_(
+ transport_context->network_settings().ice_reconnect_attempts),
weak_factory_(this) {
DCHECK(!ice_username_fragment_.empty());
}
@@ -126,9 +123,9 @@ void IceTransportChannel::Connect(const std::string& name,
--connect_attempts_left_;
// Start reconnection timer.
- reconnect_timer_.Start(
- FROM_HERE, base::TimeDelta::FromSeconds(kReconnectDelaySeconds),
- this, &IceTransportChannel::TryReconnect);
+ reconnect_timer_.Start(FROM_HERE,
+ transport_context_->network_settings().ice_timeout,
+ this, &IceTransportChannel::TryReconnect);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&IceTransportChannel::NotifyConnected,
@@ -202,7 +199,8 @@ void IceTransportChannel::OnWritableState(cricket::TransportChannel* channel) {
DCHECK_EQ(channel, static_cast<cricket::TransportChannel*>(channel_.get()));
if (channel->writable()) {
- connect_attempts_left_ = kMaxReconnectAttempts;
+ connect_attempts_left_ =
+ transport_context_->network_settings().ice_reconnect_attempts;
reconnect_timer_.Stop();
// Route change notifications are ignored when the |channel_| is not
« no previous file with comments | « no previous file | remoting/protocol/ice_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698