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

Side by Side Diff: remoting/webapp/crd/js/smart_reconnector.js

Issue 952353002: Requiem for client_screen.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Ready for Check-in Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/fullscreen.js ('k') | remoting/webapp/crd/js/toolbar.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class handling reconnecting the session when it is disconnected due to 7 * Class handling reconnecting the session when it is disconnected due to
8 * network failure. 8 * network failure.
9 * 9 *
10 * The SmartReconnector listens for changes in connection state of 10 * The SmartReconnector listens for changes in connection state of
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Therefore, delay the connection by |kReconnectDelay| to allow for the network 61 // Therefore, delay the connection by |kReconnectDelay| to allow for the network
62 // to connect. 62 // to connect.
63 remoting.SmartReconnector.kReconnectDelay = 2000; 63 remoting.SmartReconnector.kReconnectDelay = 2000;
64 64
65 // If the video channel is inactive for 10 seconds reconnect the session. 65 // If the video channel is inactive for 10 seconds reconnect the session.
66 remoting.SmartReconnector.kConnectionTimeout = 10000; 66 remoting.SmartReconnector.kConnectionTimeout = 10000;
67 67
68 remoting.SmartReconnector.prototype = { 68 remoting.SmartReconnector.prototype = {
69 reconnect_: function() { 69 reconnect_: function() {
70 this.cancelPending_(); 70 this.cancelPending_();
71 remoting.disconnect(); 71 remoting.app.disconnect();
72 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); 72 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
73 this.connector_.reconnect(); 73 this.connector_.reconnect();
74 }, 74 },
75 75
76 reconnectAsync_: function() { 76 reconnectAsync_: function() {
77 this.cancelPending_(); 77 this.cancelPending_();
78 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); 78 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
79 this.reconnectTimerId_ = window.setTimeout( 79 this.reconnectTimerId_ = window.setTimeout(
80 this.bound_.reconnect, remoting.SmartReconnector.kReconnectDelay); 80 this.bound_.reconnect, remoting.SmartReconnector.kReconnectDelay);
81 }, 81 },
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 dispose: function() { 125 dispose: function() {
126 this.clientSession_.removeEventListener( 126 this.clientSession_.removeEventListener(
127 remoting.ClientSession.Events.stateChanged, 127 remoting.ClientSession.Events.stateChanged,
128 this.bound_.stateChanged); 128 this.bound_.stateChanged);
129 this.clientSession_.removeEventListener( 129 this.clientSession_.removeEventListener(
130 remoting.ClientSession.Events.videoChannelStateChanged, 130 remoting.ClientSession.Events.videoChannelStateChanged,
131 this.bound_.videoChannelStateChanged); 131 this.bound_.videoChannelStateChanged);
132 } 132 }
133 }; 133 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/fullscreen.js ('k') | remoting/webapp/crd/js/toolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698