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

Unified Diff: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js

Issue 895783003: Files.app: Split the startRequests method of metadata models into createRequests and startRequests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments. Created 5 years, 11 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/metadata/metadata_cache_item_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js
index 707d405fd29dca5946c4d51c0696c1b98e3c3e54..ee140f2a5cab8063a3b19736220636a41569af56 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item.js
@@ -17,13 +17,11 @@ function MetadataCacheItem() {
}
/**
- * Marks invalidated properies as loading and returns property names that are
- * need to be loaded.
- * @param {number} requestId
+ * Creates requested names that need to be loaded.
* @param {!Array<string>} names
- * @return {!Array<string>} Load requested names.
+ * @return {!Array<string>} Property names that need to be loaded.
*/
-MetadataCacheItem.prototype.startRequests = function(requestId, names) {
+MetadataCacheItem.prototype.createRequests = function(names) {
var loadRequested = [];
for (var i = 0; i < names.length; i++) {
var name = names[i];
@@ -33,13 +31,24 @@ MetadataCacheItem.prototype.startRequests = function(requestId, names) {
MetadataCacheItemPropertyState.INVALIDATED) {
continue;
}
+ loadRequested.push(name);
+ }
+ return loadRequested;
+};
+
+/**
+ * Marks the given properies as loading.
+ * @param {number} requestId
+ * @param {!Array<string>} names
+ */
+MetadataCacheItem.prototype.startRequests = function(requestId, names) {
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
if (!this.properties_[name])
this.properties_[name] = new MetadataCacheItemProperty();
this.properties_[name].requestId = requestId;
this.properties_[name].state = MetadataCacheItemPropertyState.LOADING;
- loadRequested.push(name);
}
- return loadRequested;
};
/**
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/metadata/metadata_cache_item_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698