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

Unified Diff: remoting/webapp/smart_reconnector.js

Issue 297963005: Make reconnection in response to video channel inactivity less aggressive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/smart_reconnector.js
diff --git a/remoting/webapp/smart_reconnector.js b/remoting/webapp/smart_reconnector.js
index 55186b4205e68abd76e6d0cd58eae5af10e639ec..7cc50bfb0257fb4f0a30b5514851a994a00de259 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) {
Wez 2014/05/23 20:26:40 Would it be better to just have a shorter timeout
Sergey Ulanov 2014/05/23 20:38:36 navigator.onLine=true just tells us that the machi
- this.reconnect_();
- } else {
- window.addEventListener(
+ window.addEventListener(
'online', this.bound_.startReconnectTimeout, false);
- }
}
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698