Index: remoting/webapp/base/js/base.js |
diff --git a/remoting/webapp/base/js/base.js b/remoting/webapp/base/js/base.js |
index d3599a56911d814fe2a3bff8dc09a4a9e3266b84..baa3cba80ab0b907eb08adefe7ec6884d8715053 100644 |
--- a/remoting/webapp/base/js/base.js |
+++ b/remoting/webapp/base/js/base.js |
@@ -507,7 +507,7 @@ base.EventSourceImpl.prototype = { |
* |
* @param {base.EventSource} src |
* @param {string} eventName |
- * @param {function(...?)} listener |
+ * @param {Function} listener |
* |
* @constructor |
* @implements {base.Disposable} |
@@ -526,9 +526,9 @@ base.EventHook.prototype.dispose = function() { |
/** |
* An event hook implementation for DOM Events. |
* |
- * @param {HTMLElement|Element} src |
+ * @param {HTMLElement|Element|Window|HTMLDocument} src |
* @param {string} eventName |
- * @param {function(...?)} listener |
+ * @param {Function} listener |
* @param {boolean} capture |
* |
* @constructor |
@@ -551,7 +551,7 @@ base.DomEventHook.prototype.dispose = function() { |
* An event hook implementation for Chrome Events. |
* |
* @param {chrome.Event} src |
- * @param {function(...?)} listener |
+ * @param {Function} listener |
* |
* @constructor |
* @implements {base.Disposable} |
@@ -566,6 +566,20 @@ base.ChromeEventHook.prototype.dispose = function() { |
this.src_.removeListener(this.listener_); |
}; |
+/** |
+ * A disposable repeating timer. |
+ * |
+ * @constructor |
+ * @implements {base.Disposable} |
+ */ |
+base.RepeatingTimer = function(/** Function */callback, /** number */interval) { |
+ this.intervalId_ = window.setInterval(callback, interval); |
+}; |
+ |
+base.RepeatingTimer.prototype.dispose = function() { |
+ window.clearInterval(this.intervalId_); |
+ this.intervalId_ = null; |
+}; |
/** |
* Converts UTF-8 string to ArrayBuffer. |