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

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

Issue 2856533003: Add background-wide file metadata cache. (Closed)
Patch Set: Rename global_metadata_cache to metadata_proxy. Created 3 years, 7 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/common/js/importer_common.js
diff --git a/ui/file_manager/file_manager/common/js/importer_common.js b/ui/file_manager/file_manager/common/js/importer_common.js
index d4772e373ff29a11c4847c6282425cb360817bf1..a609be1cb1b6e53d6b936ec50740ba40ce4415c4 100644
--- a/ui/file_manager/file_manager/common/js/importer_common.js
+++ b/ui/file_manager/file_manager/common/js/importer_common.js
@@ -643,42 +643,6 @@ importer.inflateAppUrl = function(deflated) {
};
/**
- * @param {!FileEntry} fileEntry
- * @return {!Promise<string>} Resolves with a "hashcode" consisting of
- * just the last modified time and the file size.
- */
-importer.createMetadataHashcode = function(fileEntry) {
- var entry = new importer.PromisingFileEntry(fileEntry);
- return new Promise(
- /**
- * @param {function()} resolve
- * @param {function()} reject
- * @this {importer.PersistentImportHistory}
- */
- function(resolve, reject) {
- entry.getMetadata()
- .then(
- /**
- * @param {!Object} metadata
- * @return {!Promise<string>}
- * @this {importer.PersistentImportHistory}
- */
- function(metadata) {
- if (!('modificationTime' in metadata)) {
- reject('File entry missing "modificationTime" field.');
- } else if (!('size' in metadata)) {
- reject('File entry missing "size" field.');
- } else {
- var secondsSinceEpoch =
- importer.toSecondsFromEpoch(metadata.modificationTime);
- resolve(secondsSinceEpoch + '_' + metadata.size);
- }
- }.bind(this));
- }.bind(this))
- .catch(importer.getLogger().catcher('importer-common-create-hashcode'));
-};
-
-/**
* @param {string} date A date string in the form
* expected by Date.parse.
* @return {string} The number of seconds from epoch to the date...as a string.

Powered by Google App Engine
This is Rietveld 408576698