summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-24 03:13:09 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-24 03:13:09 +0000
commit8204ede6262a8d7aa0c76f399c6c435babd0855b (patch)
tree888f8e62c42319514771ad7a3caa216ffd575e30 /remoting
parent4fb02eab9eb183509b71844e6f88ab9a2bc2489c (diff)
downloadchromium_src-8204ede6262a8d7aa0c76f399c6c435babd0855b.zip
chromium_src-8204ede6262a8d7aa0c76f399c6c435babd0855b.tar.gz
chromium_src-8204ede6262a8d7aa0c76f399c6c435babd0855b.tar.bz2
Make reconnection in response to video channel inactivity less aggressive.
Previously immediate reconnection was triggered by the video channel becoming inactive. That can cause spurious reconnects on flaky networks. Now the webapp will always wait for 10 seconds before trying to reconnect. BUG=375568 Review URL: https://codereview.chromium.org/297963005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/smart_reconnector.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/remoting/webapp/smart_reconnector.js b/remoting/webapp/smart_reconnector.js
index 55186b42..7cc50bf 100644
--- a/remoting/webapp/smart_reconnector.js
+++ b/remoting/webapp/smart_reconnector.js
@@ -62,8 +62,7 @@ remoting.SmartReconnector = function(connector, clientSession) {
// to connect.
remoting.SmartReconnector.kReconnectDelay = 2000;
-// If no frames are received from the server for more than |kConnectionTimeout|,
-// disconnect the session.
+// If the video channel is inactive for 10 seconds reconnect the session.
remoting.SmartReconnector.kConnectionTimeout = 10000;
remoting.SmartReconnector.prototype = {
@@ -97,22 +96,13 @@ remoting.SmartReconnector.prototype = {
},
/**
- * @param {boolean} active This function is called if no frames are received
- * on the client for more than 1 second.
+ * @param {boolean} active True if the video channel is active.
*/
videoChannelStateChanged_: function (active) {
this.cancelPending_();
if (!active) {
- // If the channel becomes inactive due to a lack of network connection,
- // wait for it to go online. The plugin will try to reconnect the video
- // channel once it is online. If the video channels doesn't finish
- // reconnecting within the timeout, tear down the session and reconnect.
- if (navigator.onLine) {
- this.reconnect_();
- } else {
- window.addEventListener(
+ window.addEventListener(
'online', this.bound_.startReconnectTimeout, false);
- }
}
},