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

Unified Diff: ui/file_manager/gallery/js/gallery_item.js

Issue 420743002: Gallery: Store image caches in Gallery items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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/gallery/js/gallery_item.js
diff --git a/ui/file_manager/gallery/js/gallery_item.js b/ui/file_manager/gallery/js/gallery_item.js
index 18c9c95043050a6a1e5a065cb6ac44b8a3cb17f7..7f146ada36937acf8534e304108fb33ece53139a 100644
--- a/ui/file_manager/gallery/js/gallery_item.js
+++ b/ui/file_manager/gallery/js/gallery_item.js
@@ -27,10 +27,34 @@ Gallery.Item = function(entry, metadata, metadataCache, original) {
/**
* @type {MetadataCache}
+ * @private
*/
this.metadataCache_ = metadataCache;
/**
+ * The content cache is used for prefetching the next image when going through
+ * the images sequentially. The real life photos can be large (18Mpix = 72Mb
+ * pixel array) so we want only the minimum amount of caching.
+ * @type {Canvas}
+ */
+ this.screenImage = null;
+
+ /**
+ * We reuse previously generated screen-scale images so that going back to a
+ * recently loaded image looks instant even if the image is not in the content
+ * cache any more. Screen-scale images are small (~1Mpix) so we can afford to
+ * cache more of them.
+ * @type {Canvas}
+ */
+ this.contentImage = null;
+
+ /**
+ * Last accessed date to be used for selecting items whose cache are evicted.
+ * @type {Date}
+ */
+ this.lastAccessed = Date.now();
mtomasz 2014/07/28 05:13:01 This seems never updated? Is it OK?
hirono 2014/07/28 06:50:32 The property is updated in the evictCache function
+
+ /**
* @type {boolean}
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698