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

Unified Diff: third_party/google_input_tools/third_party/closure_library/closure/goog/async/delay.js

Issue 1257313003: Update Google Input Tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Free up grd resources. Created 5 years, 5 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: 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.
*/

Powered by Google App Engine
This is Rietveld 408576698