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

Unified Diff: ui/file_manager/file_manager/common/js/util.js

Issue 2833413003: Reuse FileTasks when entries are not changed. (Closed)
Patch Set: Use getter for FileTasks.entries. Created 3 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
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_tasks.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/common/js/util.js
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js
index f3e698d638e2eb30f5addc0efe1847ec47762fea..fe46d0d10ae0bfea81b6ece64b34ac068548e49d 100644
--- a/ui/file_manager/file_manager/common/js/util.js
+++ b/ui/file_manager/file_manager/common/js/util.js
@@ -683,6 +683,28 @@ util.isSameEntry = function(entry1, entry2) {
};
/**
+ * Compares two entry arrays.
+ * @param {Array<!Entry>} entries1 The entry array to be compared.
+ * @param {Array<!Entry>} entries2 The entry array to be compared.
+ * @return {boolean} True if the both arrays contain same files or directories
+ * in the same order. Returns true if both arrays are null.
+ */
+util.isSameEntries = function(entries1, entries2) {
+ if (!entries1 && !entries2)
+ return true;
+ if (!entries1 || !entries2)
+ return false;
+ if (entries1.length !== entries2.length)
+ return false;
+ for (var i = 0; i < entries1.length; i++) {
+ if (!util.isSameEntry(entries1[i], entries2[i])) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
* Compares two file systems.
* @param {FileSystem} fileSystem1 The file system to be compared.
* @param {FileSystem} fileSystem2 The file system to be compared.
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_tasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698