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

Unified Diff: chrome/browser/resources/file_manager/js/async_util.js

Issue 25278002: Extract ContentScanner from DirectoryContent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/directory_contents.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f74a9d493810a66f18f1bb0705665d0dfe80ad0e 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() {
+ this.closures_ = [];
+};
+
+/**
* Creates a class for executing several asynchronous closures in a group in
* a dependency order.
*
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/directory_contents.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698