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

Unified Diff: remoting/webapp/base/js/base.js

Issue 1091103002: [Webapp Refactor] Fix styles in SmartReconnector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use base.OneShotTimer and base.EventHooks Created 5 years, 8 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
Index: remoting/webapp/base/js/base.js
diff --git a/remoting/webapp/base/js/base.js b/remoting/webapp/base/js/base.js
index 73a5b3abf20bcfda4466771e2ac7c9cd389bd477..1b2e853175b17cbe7082b37c452249f8f63935c4 100644
--- a/remoting/webapp/base/js/base.js
+++ b/remoting/webapp/base/js/base.js
@@ -682,6 +682,22 @@ base.RepeatingTimer.prototype.dispose = function() {
};
/**
+ * A disposable one shot timer.
+ *
+ * @constructor
+ * @implements {base.Disposable}
+ */
+base.OneShotTimer = function(/** Function */ callback, /** number */ timeout) {
Jamie 2015/04/16 20:05:48 We have used the longer form of jsdoc annotation f
kelvinp 2015/04/16 20:57:58 Done.
+ /** @private */
+ this.timerId_ = window.setTimeout(callback, timeout);
+};
+
+base.OneShotTimer.prototype.dispose = function() {
+ window.clearTimeout(this.timerId_);
+ this.timerId_ = null;
+};
+
+/**
* Converts UTF-8 string to ArrayBuffer.
*
* @param {string} string
« no previous file with comments | « no previous file | remoting/webapp/crd/js/smart_reconnector.js » ('j') | remoting/webapp/crd/js/smart_reconnector.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698