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

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

Issue 803653004: Update Chromoting to use /third_party/closure_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused types Created 5 years, 11 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 },
82 82
83 /** 83 /**
84 * @param {remoting.ClientSession.StateEvent} event 84 * @param {remoting.ClientSession.StateEvent=} event
kelvinp 2015/01/12 22:51:28 why the =?
garykac 2015/01/13 00:28:39 base.EventSource.prototype.addEventListener is def
85 */ 85 */
86 stateChanged_: function(event) { 86 stateChanged_: function(event) {
87 var State = remoting.ClientSession.State; 87 var State = remoting.ClientSession.State;
88 if (event.previous === State.CONNECTED && event.current === State.FAILED) { 88 if (event.previous === State.CONNECTED && event.current === State.FAILED) {
89 this.cancelPending_(); 89 this.cancelPending_();
90 if (navigator.onLine) { 90 if (navigator.onLine) {
91 this.reconnect_(); 91 this.reconnect_();
92 } else { 92 } else {
93 window.addEventListener('online', this.bound_.reconnectAsync, false); 93 window.addEventListener('online', this.bound_.reconnectAsync, false);
94 } 94 }
95 } 95 }
96 }, 96 },
97 97
98 /** 98 /**
99 * @param {boolean} active True if the video channel is active. 99 * @param {boolean=} active True if the video channel is active.
100 */ 100 */
101 videoChannelStateChanged_: function (active) { 101 videoChannelStateChanged_: function (active) {
102 this.cancelPending_(); 102 this.cancelPending_();
103 if (!active) { 103 if (!active) {
104 window.addEventListener( 104 window.addEventListener(
105 'online', this.bound_.startReconnectTimeout, false); 105 'online', this.bound_.startReconnectTimeout, false);
106 } 106 }
107 }, 107 },
108 108
109 startReconnectTimeout_: function () { 109 startReconnectTimeout_: function () {
(...skipping 14 matching lines...) Expand all
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

Powered by Google App Engine
This is Rietveld 408576698