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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_contents.js

Issue 520553002: Correct cache-size calculation of MetadataCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment for metadata size synchronization. Created 6 years, 4 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/directory_model.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/directory_contents.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js
index c1b0f2bc3947a9823f928f68e807d95b4cc921ac..a436f9459183a4433c33e781e10cc34c684f80c9 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_contents.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -566,6 +566,9 @@ DirectoryContents.prototype.clone = function() {
*/
DirectoryContents.prototype.dispose = function() {
this.context_.metadataCache.resizeBy(-this.lastSpaceInMetadataCache_);
+ // Though the lastSpaceInMetadataCache_ is not supposed to be referred after
+ // dispose(), keep it synced with requested cache size just in case.
+ this.lastSpaceInMetadataCache_ = 0;
};
/**
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/directory_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698