Index: chrome/browser/resources/file_manager/js/async_util.js |
diff --git a/chrome/browser/resources/file_manager/js/async_util.js b/chrome/browser/resources/file_manager/js/async_util.js |
index 9b7639b5f40de0131bb58e8aeb9845b8165f7481..9a74bdbd8f915ce7fa2a1bc9f0097a2114b1582f 100644 |
--- a/chrome/browser/resources/file_manager/js/async_util.js |
+++ b/chrome/browser/resources/file_manager/js/async_util.js |
@@ -53,6 +53,13 @@ AsyncUtil.Queue = function() { |
}; |
/** |
+ * @return {boolean} True when a task is running, otherwise false. |
+ */ |
+AsyncUtil.Queue.prototype.isRunning = function() { |
+ return this.running_; |
+}; |
+ |
+/** |
* Enqueues a closure to be executed. |
* @param {function(function())} closure Closure with a completion callback to |
* be executed. |
@@ -80,6 +87,14 @@ AsyncUtil.Queue.prototype.continue_ = function() { |
}; |
/** |
+ * Cancels all pending tasks. Note that this does NOT cancel the task running |
+ * currently. |
+ */ |
+AsyncUtil.Queue.prototype.cancel = function() { |
mtomasz
2013/10/01 02:13:44
FYI: A more complete cancellation logic is planned
hidehiko
2013/10/01 04:12:23
Good to know. As we talked offline, please let me
|
+ this.closures_.splice(0, this.closures_.length); |
mtomasz
2013/10/01 02:13:44
nit: How about just this.closures_ = []?
hidehiko
2013/10/01 04:12:23
Done.
|
+}; |
+ |
+/** |
* Creates a class for executing several asynchronous closures in a group in |
* a dependency order. |
* |