Index: third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js |
diff --git a/third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js b/third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js |
index 1c5916a216e3825b22b3bf6251c03361a8e2cee8..bde663a676e8a93d5aa3208cd25aecaf0ce004ef 100644 |
--- a/third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js |
+++ b/third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js |
@@ -36,21 +36,24 @@ goog.require('goog.Timer'); |
* each time the delay is started. Calling start on an active delay will reset |
* the timer. |
* |
- * @param {Function} listener Function to call when the delay completes. |
+ * @param {function(this:THIS)} listener Function to call when the |
+ * delay completes. |
* @param {number=} opt_interval The default length of the invocation delay (in |
* milliseconds). |
- * @param {Object=} opt_handler The object scope to invoke the function in. |
+ * @param {THIS=} opt_handler The object scope to invoke the function in. |
+ * @template THIS |
* @constructor |
+ * @struct |
+ * @suppress {checkStructDictInheritance} |
* @extends {goog.Disposable} |
* @final |
*/ |
goog.async.Delay = function(listener, opt_interval, opt_handler) { |
- goog.Disposable.call(this); |
+ goog.async.Delay.base(this, 'constructor'); |
/** |
* The function that will be invoked after a delay. |
- * @type {Function} |
- * @private |
+ * @private {function(this:THIS)} |
*/ |
this.listener_ = listener; |
@@ -104,7 +107,7 @@ goog.async.Delay.prototype.id_ = 0; |
* @protected |
*/ |
goog.async.Delay.prototype.disposeInternal = function() { |
- goog.async.Delay.superClass_.disposeInternal.call(this); |
+ goog.async.Delay.base(this, 'disposeInternal'); |
this.stop(); |
delete this.listener_; |
delete this.handler_; |
@@ -127,6 +130,19 @@ goog.async.Delay.prototype.start = function(opt_interval) { |
/** |
+ * Starts the delay timer if it's not already active. |
+ * @param {number=} opt_interval If specified and the timer is not already |
+ * active, overrides the object's default interval with this one (in |
+ * milliseconds). |
+ */ |
+goog.async.Delay.prototype.startIfNotActive = function(opt_interval) { |
+ if (!this.isActive()) { |
+ this.start(opt_interval); |
+ } |
+}; |
+ |
+ |
+/** |
* Stops the delay timer if it is active. No action is taken if the timer is not |
* in use. |
*/ |