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

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

Issue 310633002: Files.app: Let DirectoryContents controls metadata cache size by relative value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | « ui/file_manager/file_manager/foreground/js/directory_model.js ('k') | no next file » | 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.js
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
index 1071a3bc895aa3bf0a6fdd43b6e891d673e6f1c4..a6e47852e80532953530942ed46d379711feee9b 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
@@ -163,12 +163,15 @@ MetadataCache.prototype.isInitialized = function() {
};
/**
- * Sets the size of cache. The actual cache size may be larger than the given
- * value.
- * @param {number} size The cache size to be set.
+ * Changes the size of cache by delta value. The actual cache size may be larger
+ * than the given value.
+ *
+ * @param {number} delta The delta size to be changed the cache size by.
*/
-MetadataCache.prototype.setCacheSize = function(size) {
- this.currentCacheSize_ = size;
+MetadataCache.prototype.resizeBy = function(delta) {
+ this.currentCacheSize_ += delta;
+ if (this.currentCacheSize_ < 0)
+ this.currentCacheSize_ = 0;
if (this.totalCount_ > this.currentEvictionThreshold_())
this.evict_();
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/directory_model.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698