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

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

Issue 1126043005: Make re-scanning of devices much faster by caching content hashcodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test. Created 5 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/lru_cache.js
diff --git a/ui/file_manager/file_manager/common/js/lru_cache.js b/ui/file_manager/file_manager/common/js/lru_cache.js
index ab1addf78b6f89feed0d0c303cdbd0f3474d7bc1..5139e607438721438e8bf696ddf2aef399d4a054 100644
--- a/ui/file_manager/file_manager/common/js/lru_cache.js
+++ b/ui/file_manager/file_manager/common/js/lru_cache.js
@@ -127,6 +127,15 @@ LRUCache.prototype.peek = function(key) {
};
/**
+ * Returns true if the cache contains the key.
+ * @param {string} key
+ * @return {boolean}
+ */
+LRUCache.prototype.hasKey = function(key) {
+ return key in this.nodes_;
+};
+
+/**
* Saves an item in this cache. The saved item will be the most recently used
* item and won't be evicted soon. If an item with the same key already exists
* in the cache, the existing item's value and size will be updated and the item
« no previous file with comments | « ui/file_manager/file_manager/background/js/media_scanner.js ('k') | ui/file_manager/file_manager/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698