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

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

Issue 904003002: Files.app: Start to use new metadata models in DirectoryContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata.js b/ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata.js
index 93e03ee9cf6a2cdf66c1e6c86cb56a208f553b6d..a50f156b52a8e1aa379b150ade629618bbf466be 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/file_system_metadata.js
@@ -64,8 +64,13 @@ FileSystemMetadata.prototype.get = function(entries, names) {
}
}
+ // Correct property names that are valid for fileSystemMetadataProvider.
+ var fileSystemPropertyNames = names.filter(function(name) {
+ return name === 'size' || name === 'modificationTime';
+ });
+
return Promise.all([
- this.fileSystemMetadataProvider_.get(localEntries, names),
+ this.fileSystemMetadataProvider_.get(localEntries, fileSystemPropertyNames),
this.externalMetadataProvider_.get(externalEntries, names)
]).then(function(results) {
var integratedResults = [];
@@ -95,6 +100,23 @@ FileSystemMetadata.prototype.getCache = function(entries, names) {
* Clears old metadata for newly created entries.
* @param {!Array<!Entry>} entries
*/
-FileSystemMetadata.prototype.notifyEntryCreated = function(entries) {
- this.cache_.clear(entries);
+FileSystemMetadata.prototype.notifyEntriesCreated = function(entries) {
+ this.cache_.clear(util.entriesToURLs(entries));
+};
+
+/**
+ * Clears metadata for deleted entries.
+ * @param {!Array<string>} urls Note it is not an entry list because we cannot
+ * obtain entries after removing them from the file system.
+ */
+FileSystemMetadata.prototype.notifyEntriesRemoved = function(urls) {
+ this.cache_.clear(urls);
+};
+
+/**
+ * Invalidates metadata for updated entries.
+ * @param {!Array<!Entry>} entries
+ */
+FileSystemMetadata.prototype.notifyEntriesChanged = function(entries) {
+ this.cache_.invalidate(this.cache_.generateRequestId(), entries);
};

Powered by Google App Engine
This is Rietveld 408576698